dailymotion API IE9 的 postMessage 错误

dailymotion API postMessage error with IE9

我想使用 dailymotion 播放器 API 并且 post 消息不适用于 ie9 (windows 7)。

var dmplayer = document.getElementById("dmplayer");
var source = null;
var origin = null;
var postMessageListener = function (e) {
    if(source == null && (e.origin === "http://www.dailymotion.com" || e.origin === "https://www.dailymotion.com")){
        source = e.source;
        origin = e.origin;
    }
};        
window.attachEvent("onmessage", postMessageListener); //ie9 only
<iframe style="position:absolute;height:100%;width:100%;top:0;left:0;padding:0;margin:0;" src="http://www.dailymotion.com/embed/video/x2m8jpp?api=1&wmode=opaque" id="dmplayer" width="100%" height="100%" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

当我运行source.postMessage('play', origin) 我收到此错误:

Object doesn't support property or method 'apply' x2m8jpp?api=1&wmode=opaque, line 1 character 1

有人有解决办法吗?

谢谢。

已在此处修复:https://github.com/dailymotion/dailymotion-sdk-js/commit/0f5d595aa51b00fc7c4e13497505c4a0d1a902c2

请尝试使用最新的 sdk 版本