【问题标题】:dailymotion API postMessage error with IE9IE9 的dailymotion API postMessage 错误
【发布时间】:2015-12-21 20:46:54
【问题描述】:

我想使用 dailymotion 播放器 API,但发布消息不适用于 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) 我收到此错误:

对象不支持属性或方法 'apply' x2m8jpp?api=1&wmode=opaque,第 1 行字符 1

有人有解决办法吗?

谢谢。

【问题讨论】:

    标签: internet-explorer-9 postmessage dailymotion-api


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-15
      • 1970-01-01
      • 2018-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-14
      相关资源
      最近更新 更多