Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3638

How to inspect why YouTube player onStateChange doesn't trigger

$
0
0

On a web page, I created YouTube player objects with new YT.Player(id, {events: {'onStateChange': ...}}). The resulting players have players[i].options.events.onStateChange. The iframes have message event listeners.

But that onStateChange event doesn't trigger for some of the players in one particular browser tab that is currently open. The line d.j.G(e,h) in www-widgetapi.js is not reached when those problematic players pause or play. It is reached for the other players.

When I open the same page in a new tab, all events get triggered. So it's a rare error (possibly depending on the order of loaded content and/or user actions). I can't replicate it consistently, let alone work towards a minimal example. So I want to inspect it in the currently open browser tab where it occurred.

How can I inspect why the existing onStateChange event doesn't trigger for those players in that browser tab?

I've read a dozen of posts about onStateChange not triggering, but my code doesn't have the same bugs that those posts describe.


Viewing all articles
Browse latest Browse all 3638

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>