我只是在IE8中检查我的YouTube播放器,并注意到'onReady','onStateChange'事件没有触发。正在调用initPlayer方法,视频播放,但事件不会触发。Youtube iframe api:'onReady','onStateChange'在IE中没有触发8
按照预期在Safari,Firefox Mac,FireFox Win上运行。
我在这里错过了什么吗?
下面是相关代码:
MyPlayer.prototype = {
/* [...] */
initPlayer: function() {
var that = this;
alert("initPlayer: (IE 8 gets this far)");
this.player = new YT.Player(this.cfg.divTagId, {
height: this.cfg.height,
width: this.cfg.width,
videoId: this.cfg.videoId,
origin: location.host,
playerVars: {
controls: this.cfg.controls,
wmode: 'opaque',
fs: 0
},
events: {
'onReady': function (event) {alert("onReady")},
'onStateChange': function (event) {alert("onChange")}
}
});
},
/* [...] */
}