According to the documentation
calling an embed with the url http://www.youtube.com/v/VIDEO_ID?version=3&enablejsapi=1 should trigger the callback onYouTubePlayerReady() when the video is ready. I have tried to achive this like this:
<body>
<iframe id="ytplayer" type="text/html" width="100%" height="56.25"
src="http://www.youtube.com/v/M7lc1UVf-VE?version=3&enablejsapi=1&playerapiid=ytplayer"
frameborder="0" allowfullscreen></iframe>
</body>
Javascript:
function onYouTubePlayerReady(playerID){
console.log(playerID);
console.log('working');
alert('working');
}
But the callback isn't triggered, see js-fiddle: what am i doing wrong?