我正在尝试在我的网站上运行 YT 播放器,但 IE8 和 IE9 存在问题 - 播放器未加载。 http://code.google.com/intl/pl/apis/youtube/youtube_player_demo.html
代码:
$(document).ready(function() {
loadPlayer('{$videos[0].videoID}','{$playlist}');
}
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("ytPlayer");
ytplayer.addEventListener("onError", "onPlayerError");
ytplayer.addEventListener("onStateChange", 'onStateChange');
}
function loadPlayer(ytID,ytList) {
var videoID = ytID;
var params = {
allowScriptAccess: "always",
allowFullScreen: true
};
var atts = {
id: "ytPlayer"
};
swfobject.embedSWF("http://www.youtube.com/v/" + videoID +
"?version=3&enablejsapi=1&playerapiid=player1&autohide=1&showinfo=0&autoplay=1&controls=1&loop=1&fs=1&origin=http://www._____.com&playlist="+ytList+'&key='+devKey,
"videoDiv", "620", "350", "9", null, null, params, atts);
}