我做错了什么? YouTube播放器会替换#player元素,但永远不会调用onYouTubePlayerReady
。
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' });
};
答案 0 :(得分:0)
{ allowScriptAccess: true }
应为{ allowScriptAccess: 'always' }