-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Reuse players (to circumvent Chrome autoplay issues) #12
Conversation
Thanks for the PR. I might take a look and attempt a slightly less disruptive fix for this (before I start getting anal and we go back and forth reviewing this PR) but this is definitely a good start. I appreciate the effort! |
So, this fixes one use case, but doesn't quite fix the problem entirely. I still need to "prime" the player with a youtube video for it to autoplay when I queue one up later. My use case, for example:
My current thoughts for a proper fix are:
Not the cleanest of solutions, but this is the best I can think of right now, and something I'll work on this week. Rendering all players at once has it's own problems that need sorting too. |
I've attempted an alternative, more thorough fix in #13 |
Just to be clear as I'm trying to fixe the same issue on my project where I use clojurescript. In my project, I'm only playing youtube video and I'm not recreating the iframe (shouldComponentupdate false and using new props) and yet the player wait for the focus to play again ... I read the react player code and I don't see any big difference in the way to play another video so I'm asking if you have any idea of what could go wrong. Thanks ! |
@ioRekz if the |
Not in my case no :( On Tue, Dec 15, 2015 at 5:22 PM, Timothy Kempf [email protected]
|
@ioRekz from your question it sounds like you aren't actually using Note that using If I am mistaken and you are in fact using |
No I'm not because I'm using a wrapper around React from clojurescript and So yes I'm not using React player right now, but I will as soon as I can On Tue, Dec 15, 2015 at 5:29 PM, Pete Cook [email protected] wrote:
|
Closing this in light of #13. |
Why
Google Chrome recently implemented a new feature to protect users from tabs that maliciously autoplay audio content. This feature ensures that only tabs/windows that have had focus in the past can autoplay. A side effect of this issue is that the YouTube and Vimeo players (in
react-player
) can no longer autoplay if the tab/window isn't focused, even if that tab/window had focus in the past. This is becausereact-player
currently creates and destroys new iframes every time the source url changes. In order to have YouTube and Vimeo play properly while the user is in another tab/window, a change had to be made.What I did
react-player
to a render/show system rather than selective rendering. Every player is rendered, but only one player is shown at a time.How to verify
npm run start
Notes
cueVideoByUrl