jwplayer 6在IE / Edge上没有正确使用

时间:2017-03-24 07:41:02

标签: javascript html html5

我已经为我的网站集成了jwplayer。我使用jwplayer 6.12和jwtube使JWPlayer 6在HTML5模式下与YouTube一起工作。 这是我的代码:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
	<title>Demo jwPlayer Youtube playlist</title>
	<script type="text/javascript" src="jwplayer/jwplayer.js"></script>  <!-- http://webscripts.softpedia.com/script/Multimedia/Video/JW-FLV-Media-Player-41172.html -->
	<script type="text/javascript" src="jwplayer/jwtube.min.js"></script> <!-- http://powered-by-haiku.co.uk/?p=563 -->
</head>
<body>

<div id="container">Loading...</div>

<script type="text/javascript">

function init_jwplayer(){
  var jwp = jwplayer("container").setup({        
          "width": "80%",
          //"aspectratio":"16:9",
          //"stretching":"fill",
          "listbar":{
          "position": "right",
          "size": "300"
          },
          "playlist": [{
              "file": "https://www.youtube.com/watch?v=tquIfapGVqs",
              "image": "playerlogo.png",
              "title": "THE BOSS BABY #1"
          },
          {
              "file": "https://www.youtube.com/watch?v=IgCIaR8BGTg",
              "image": "playerlogo.png",
              "title": "THE BOSS BABY #2"
          },
          {
              "file": "test.mp4",
              "image": "playerlogo.png",
              "title": "Big Buck Bunny Trailer"
          }],
          "type":jwtube.setType()
      });

      // Due to a bug in JW6.7, we have to re-get the player instance
      var jwp = jwplayer("container");
      jwtube.patch(jwp);
}

    window.onload = function(){ init_jwplayer(); };

</script>

</body>
</html>

此代码适用于Firefox和Chrome。我可以很容易地改变视频。

但在IE上,它运行缓慢而且非常滞后。当我更改播放列表上的视频时,旧视频不会停止,它会继续在后台运行。旧视频和新视频都在一起播放。在控制台窗口上抛出错误:“DOM7011:此页面上的代码禁用了前后缓存。有关详细信息,请参阅:http://go.microsoft.com/fwlink/?LinkID=291337”。

我不知道如何修复它。请帮我解决。

0 个答案:

没有答案