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.