Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Video Player]: Not working properly on safary #9587

Closed
2 tasks done
tweenn opened this issue Oct 24, 2022 · 8 comments
Closed
2 tasks done

[Video Player]: Not working properly on safary #9587

tweenn opened this issue Oct 24, 2022 · 8 comments
Labels
bug Something isn't working dev Needs some dev work package: react Work necessary for the Carbon for IBM.com react components package package: web components Work necessary for the IBM.com Library web components package severity 3 Affects minor functionality, has a workaround

Comments

@tweenn
Copy link
Contributor

tweenn commented Oct 24, 2022

Description

Quick Description

The way that the video player works is failing on safari@macOS - as of now, a user has to double click a video to watch it.
Aka - click on an inline player poster and click again on the player to play it - or click in a cta/poster to open a overlay and then click again in the player to watch it.

Longer description

Player inner workings:

Northstar & Carbon create a "poster" with a thumbnail & other media-information and upon user interaction (either mouse or keyboard click) the poster goes away and the kaltura player is added to the DOM through a javascript controlled iFrame.
The player is instantiated with auto-play and muted (per browser rules) and a code-generated click is emitted through javascript to unmute the player.
This "fake" click works on other browsers 'cause the page has already been interacted with - in the form of the user clicking in the fake poster.

The problem:

In safari, the .play() action of the video element failed as it should for videos that auto-play with sound.
This mean that the fake click is working and unmuting the player but it's not considered a valid user click - triggering the browser to stop the video as like we were trying to bypass the rule.

After some study on the matter, I've found out that if the player element exists in the page in the time that the poster is clicked (aka the user interaction is generated) - this "failing behavior" won't happen, making me believe that Safari changed the rules around this first interaction of the user AND newer elements in the DOM tree.

When:

I'm not sure in which Safari release this happened (my best guess is somewhere in v15) - but it updated something around media autoplay rules and broke the video player experience.

Possible solution

Instead of instantiating the player after the user click the poster, the player has to be added on page-load - which may hinder the page speed and performance (need a more detailed study on impact)
There is a stub-not-optimised example in the "steps to reproduce" section (last link)

Component(s) impacted

Video Player
Canary Audio Player

Browser

Safari

Carbon for IBM.com version

latest

Severity

Severity 3 = The problem is visible or noticeable to users but does not impede the usability or functionality. Affects minor functionality, has a workaround.

Application/website

mediacenter.ibm.com

Package

@carbon/ibmdotcom-react, @carbon/ibmdotcom-web-components

CodeSandbox example

https://tweenn.github.io/carbon-for-ibm-dot-com-media-player-safari-examples/?path=/story/introduction--page

Steps to reproduce the issue (if applicable)

In safari, macOs, enter in any of the following pages and click on the player without clicking anywhere else in the page.

This behavior can also be observed in Northstar's youtube widget

This behavior is not happening in my (not-optimised) proposal

Release date (if applicable)

No response

Code of Conduct

@tweenn tweenn added bug Something isn't working dev Needs some dev work labels Oct 24, 2022
@oliviaflory oliviaflory added severity 3 Affects minor functionality, has a workaround package: react Work necessary for the Carbon for IBM.com react components package package: web components Work necessary for the IBM.com Library web components package labels Oct 24, 2022
@tweenn
Copy link
Contributor Author

tweenn commented Nov 2, 2022

Hey everyone!

After the Office Hours that happened today, I've agreed with @ariellalgilmore to add some extra information here, like a more detailed diagram on how the players (carbon and northstar) currently works and the changes for the proposed solution - and also how this change would affect (benefit) the audio-player that is currently in react-canary.

I'll do so in two new comments (one for each topic) - for better view in github.

@tweenn
Copy link
Contributor Author

tweenn commented Nov 2, 2022

Disclaimer

  • The northstar/v18 flow for both YouTube and IBM Video [former uStream] is here to illustrate how it was done in other players versus how we're doing with Kaltura's.
  • The proposed solution is only for the kaltura player in both frameworks and should not touch the legacy players for both YouTube and IBM Video [former uStream]

Diagrams

Current State

  • Framework: Northstar
  • Player vendors: Youtube & IBM Video [uStream]

northstar-youtube-ibmvideo


  • Framework: Northstar & Carbon
  • Player vendors: Kaltura

carbon-and-northstar-kaltura-player


Proposed Solution

  • Framework: Northstar & Carbon
  • Player vendors: Kaltura

proposed-solution

@tweenn
Copy link
Contributor Author

tweenn commented Nov 2, 2022

Audio Player

Disclaimer

The audio player ALSO suffers from double clicking in safari, but since you have "less visual clues" about it not working, the user experience is way more degraded than the video-player.


Description

As we create a poster for the video to force the user to interact with the player before invoking it in the dom, the audio player don't have such elegant solution and thus it get all interaction buttons disabled (there was a discussion around this behavior in the first PR of the audio player, here)

Here's how it look like:

audio-player-poster-mode


Now, if the player get invoked in the page before the user click, those disabled buttons can be set to enabled as soon as the player emits the "ready to play" notification through the kaltura-api, just like as if a user had clicked, making not only the user experience better but also solving the double-click-clueless issue.

audio-player-after-user-interaction

@stale
Copy link

stale bot commented May 27, 2023

We've marked this issue as stale because there hasn't been any activity for 60 days. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@andy-blum
Copy link
Contributor

I'm not seeing this in action on safari today.

https://carbon-design-system.github.io/carbon-for-ibm-dotcom/canary/web-components/iframe.html?args=&id=components-video-player--default&viewMode=story

@tweenn are you able to replicate this issue still?

@stale stale bot removed the inactive label Jun 3, 2023
@kennylam kennylam moved this to Backlog in Carbon for IBM.com Jun 21, 2023
@tweenn
Copy link
Contributor Author

tweenn commented Jun 28, 2023

@andy-blum - Sorry for the really late reply!

Unfortunately I'm still having the issue, buuuut I have to point out that I'm still using an outdate version of both MacOs and Safari!

  • MacOs: Monterey 12.6
  • Safari: Version 16.0 (17614.1.25.9.10, 17614)

I'll do a screen capture of the issue for documentation purposes and then update everything and re-do the checkins and screen-cap.

@andy-blum
Copy link
Contributor

bump @tweenn

@tweenn
Copy link
Contributor Author

tweenn commented Nov 14, 2023

Hey @andy-blum
Sorry for the humongous delay on this response.
I had lost my Mac and changed orgs, things were crazy by that time.

ANYWAY, problem still persists.

safari-16.min.mp4
safari-16-5-1.min.mp4
safari-16-5-2.min.mp4
safari-17.min.mp4

@andy-blum andy-blum closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Carbon for IBM.com Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Needs some dev work package: react Work necessary for the Carbon for IBM.com react components package package: web components Work necessary for the IBM.com Library web components package severity 3 Affects minor functionality, has a workaround
Projects
Status: Done
Development

No branches or pull requests

7 participants