Chromeless YouTube视频播放器和Internet Explorer

时间:2016-01-28 17:09:43

标签: javascript jquery internet-explorer youtube youtube-api

无Chrome的YouTube视频播放器和自定义控件的实现在Internet Explorer 11上无效。

我获得了无限错误,如:

  

“脚本87:论证无效.www-embed-player.js(541,78)

有什么想法解决这个问题吗?感谢

LINE:541

Ii.prototype.sendMessage=function(a){this.source&&(a.id=this.sourceId,a=M(a),this.source.postMessage(a,this.origin))};function Ji(){}

video-player.js iframe创建

var player;
function onYouTubePlayerAPIReady() {
  ytplayer = new YT.Player('player', {
    videoId: 'uu9J0c97fB0', 
    width: '640',       
    height: '390',        
    playerVars: {
      autoplay: 1,
      showinfo: 0,
      fs: 0
    },
    events: {
      'onReady': onPlayerReady,
      'onStateChange': onPlayerStateChange
    }
  });
} 

网页:https://github.com/brianyang/YouTube-Video-Player

1 个答案:

答案 0 :(得分:0)

解决方案不是直接从PC上的文件系统运行video-demo.html,而是在本地网络服务器中运行它。这仅用于Internet Explorer上的安全性。如果你运行http://localhost/video-demo.html它就可以了。