onYouTubePlayerReady not working in Safari
var ytplayer = [];
function onYouTubePlayerReady(playerId) {
ytplayer[playerId] = document.getElementById("myytplayer" + playerId);
ytplayer[playerId].addEventListener("onStateChange", "onStateChange" +
playerId);
$('.ytwrapper').eq(0).css('z-index', 25);
}
...
$.browser.device =
(/android|webos|iphone|ipad|ipod|blackberry/i.test(navigator.userAgent.toLowerCase()));
if (!$.browser.device) {
var params = {allowScriptAccess: "always", wmode: "opaque"};
swfobject.embedSWF("http://www.youtube.com/v/pIz2K3ArrWk?enablejsapi=1&playerapiid=0",
"ytapiplayer", "978", "248", "8", null, null, params, { id:
"myytplayer0" });
swfobject.embedSWF("http://www.youtube.com/v/1_uMQTw7v2g?enablejsapi=1&playerapiid=1",
"ytapiplayer2", "978", "248", "8", null, null, params, { id:
"myytplayer1" });
swfobject.embedSWF("http://www.youtube.com/v/QN6LSyqihSY?enablejsapi=1&playerapiid=2",
"ytapiplayer3", "978", "248", "8", null, null, params, { id:
"myytplayer2" });
}
Please help me with this issue. The swfobject is v. 2.2. Now the event
fires everywhere in desktop browsers except Safari.
Can anyone help me pinpoint the problem?
No comments:
Post a Comment