-
-
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
Fix YouTube onReady bugs #21
Conversation
Doesn't look like this fixes it... but I've got plenty of free time and a reproducible test case. I can go ahead and take care of this myself in a separate pull req if it's all the same to you |
I spent quite a while working on reproducing this bug, making a test for it, and resolving it—but I could only get one of those complete. Here are the steps I used to replicate my issue:
This will cause the player to attempt to prime the YouTube player with the empty video, thus calling My idea for fixing this would be to add a flag for keeping track of whether or not we've started initializing a YouTube player yet. Using this flag, you could check to see if a player is pending during a |
This PR should prevent that first |
5e2463d
to
f2b1003
Compare
Updated with a new approach. @Fauntleroy any better? |
Argh, still not good enough. Pausing/playing is now screwed up. |
f2b1003
to
aef79e9
Compare
Ah, never mind, I missed a |
aef79e9
to
9f87c88
Compare
This seems to be functioning as expected in both the react-player example and my application. I'm going to look over your code and see if there are any hidden gotchas before I sign off on this completely, though... |
Having trouble with this in production. Let me double check my work first |
Looks like the issue was probably caused by caching on my production server. Everything looks good to me here, though we should really start investing in tests as we move forward. |
Absolutely. Shallow rendering unit tests only get us so far. I'll open an issue. I'll merge this and publish a patch release. |
Attempts to fix #20
@Fauntleroy I'm hoping this does the job? Could you confirm?