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
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/