Problem with multiple instance
peacepostman opened this issue · 4 comments
Hello !
Firstly, thanks for the library, the wrapper is amazing.
I have a question regarding multiple YT.Player instance. We are calling new YT.Player
inside different react component but once one YT.Player is loaded, the others instances failed to boot.
I've read the Youtube Iframe documentation and i'm afraid that onYouTubeIframeAPIReady
will be only called once after the first library loading. I hope i am missing something and maybe you have a solution.
I also found this exemple (https://jsfiddle.net/wzalazar/72NYY/) but i cannot give all the players id on the first boot, some of them are loaded after the first instance.
Best regards,
If you're using the latest version of this package, then it should work with multiple instances on the same page because we save the old value of onYouTubeIframeAPIReady
before overwriting it and ensure it gets called. Make sure you don't have another package or your own code which is interfering by overwriting onYouTubeIframeAPIReady
.
If you think this is still an issue, please send a PR with a proposed fix.
Hello, thanks for your feedback, we've updated the library but unfortunately we are still encountering the same issue. I will create a codepen in order to debug it, maybe someone will have a solution.
Best regards
@peacepostman Sounds good
I'm hitting this as well. @peacepostman any luck with a solution? Thanks!