문제

What am I doing wrong? The YouTube player replaces the #player element, but onYouTubePlayerReady is never called.

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' });
};

live code: http://jsfiddle.net/patricklorio/GyMN5/

도움이 되었습니까?

해결책

{ allowScriptAccess: true } should be { allowScriptAccess: 'always' }

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top