I try to catch the events of a youtube iframe: http://lab.joergpfeiffer.de/videofull/youtube.php
So I call first the api
<script type='text/javascript' src='http://www.youtube.com/player_api'></script>
I set the iframe
<iframe id="ytfullplayer" type="text/html" width="640" height="390" src="http://www.youtube.com/p/B93C3D017CB2D65A?enablejsapi=1&origin=lab.domain.de" frameborder="0" ></iframe>
and try to set the events later in
var ytfullplayer;
function onYouTubePlayerAPIReady() {
console.log('onYouTubePlayerAPIReady');
ytfullplayer = new YT.Player('ytfullplayer', {
events: {
'onReady': testfunc,
'onPlaybackQualityChange': testfunc,
'onStateChange': testfunc,
'onError': testfunc
}
});
}
function testfunc(){ alert('hello'); }
Whatever I do, there are no events fired. And I read the iframe api 10 times. it should work actually.
Any idea?