YouTube onPlayerReady is never triggered

后端 未结 1 354
情深已故
情深已故 2021-01-23 17:50

Any idea why this script doesn\'t work? All I want is to track onStateChanged event, but that is never called either.

When I open the html document with bel

相关标签:
1条回答
  • 2021-01-23 18:51

    I found an answer here: How do I get the reference to an existing YouTube player?

    The reason my solution didn't work, was that my iframe was missing an attribute: enablejsapi="1" and also I was missing: ?enablejsapi=1 in YouTube video url.

    You may find the working solution here: http://jsfiddle.net/bf7zQ/2/

    0 讨论(0)
提交回复
热议问题