{ allowScriptAccess: true }
should be { allowScriptAccess: 'always' }
onYouTubePlayerReady not being called after load with swfobject
-
05-08-2022 - |
Question
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/
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow