0
我做錯了什麼? YouTube播放器替換了#播放器元素,但不會調用onYouTubePlayerReady
。onYouTubePlayerReady未被swfobject加載後調用
window.onYouTubePlayerReady = function() {
alert('success!');
console.log('yt player loaded!', arguments);
}
window.onload = function() {
swfobject.embedSWF('http://www.youtube.com/v/S57AWoY6zDQ?version=3&enablejsapi=1',
'player', 800, 600, '8', null, null,
{ allowScriptAccess: true }, { id: 'myYTplayer' });
};
現場代碼:http://jsfiddle.net/patricklorio/GyMN5/