如何为无边框播放器动态创建播放列表?

时间:2013-04-27 22:50:31

标签: youtube-api youtube-javascript-api

我的工作区位于:http://jsfiddle.net/WBFa4/89/ 我正在尝试检测视频的结尾以加载下一个视频.onStateChange事件永远不会被触发。可能是什么问题?

swfobject.embedSWF
 (
    'http://www.youtube.com/apiplayer?enablejsapi=1&version=3',
    'ytplayer_div1',
'425',
'344',
'8',
null,
null,
{
    allowScriptAccess: 'always',
            allowFullScreen: 'true'
},
{
    id: 'ytplayer_object'
}
);
onYouTubePlayerReady = function() {
var ytplayer = document.getElementById("ytplayer_object");
addEventListener("onStateChange","handlestatechange");  
ytplayer.loadVideoById("V2AshX3tfHU", 5, "large");
}
function handlestatechange(state) {
 if(state==0) {
    ytplayer.loadVideoById("bHQqvYy5KYo");
 }
}

0 个答案:

没有答案