VideoJS无法在IE8中播放,但可以在FireFox,Chrome和Safari中播放 [英] VideoJS Won't play in IE8 but plays in FireFox, Chrome and Safari

查看:79
本文介绍了VideoJS无法在IE8中播放,但可以在FireFox,Chrome和Safari中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让VideoJS播放2天的演示视频而IE8没有运气。我可以在Firefox,Chrome和Safari中播放它。我得到的只是一个视频应该是的黑盒子。页面很简单。任何人都可以为我做这件事吗?

I have been trying to get VideoJS to play the demo video for 2 days with no luck in IE8. I can get it to play in Firefox, Chrome and Safari. All I get is a black box where the video should be. The page is simple. Can anyone shed som elight on this for me?

谢谢...

来源是:

<!doctype html>
<!--[if lt IE 7]><html class="no-js ie6 oldie" lang=en><![endif]-->
<!--[if IE 7]><html class="no-js ie7 oldie" lang=en><![endif]-->
<!--[if IE 8]><html class="no-js ie8 oldie" lang=en><![endif]-->

<!--[if gt IE 8]><!--> <html class=no-js lang=en> <!--<![endif]-->
<head>
  <meta charset=utf-8>
  <title>Test VideoJSPlayback</title>
  <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

  <link rel=stylesheet href="http://vjs.zencdn.net/3.2/video-js.css" type="text/css">
  <script type="text/javascript" src="http://vjs.zencdn.net/3.2/video.js"></script>
  <script src="http://www1.videojs.com/js/libs/modernizr-2.0.6.min.js"></script>
</head>

<body>

  <div id=player_box>

    <video id=home_video class="video-js vjs-default-skin" controls preload=none width=640 height=264
        poster="http://video-js.zencoder.com/oceans-clip.jpg">
      <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'/>
      <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'/>
      <track kind=captions src="/video-js/captions.vtt" srclang=en label=English />
    </video>

    <script>var homePlayer=_V_("home_video");</script>

  </div>

</body>
</html>


推荐答案

您可能知道IE 8不支持HTML5视频回放,所以video-js做的是利用video-js.swf对mp4文件进行编码,并提供Flash版本而无需其他文件。

As you probably know IE 8 does not support HTML5 video playback, so what video-js does is utilize video-js.swf to encode the mp4 file and serve a "Flash version" without the need for additional files.

在视频广告代码中添加报价。

Add quotations to your video tag.


<video id="home_video" class="video-js vjs-default-skin" controls preload="none" width="640" height="264">
...
</video>


另外,在你的video-js JavaScript文件中搜索video -js.swf查找此文件的引用位置,如果您使用的是本地版本,请确保路径正确,如果没有,请确保您没有因为跨域文件解释或MIME错误而在IE中收到任何JavaScript错误。

Also, In your video-js JavaScript file search for "video-js.swf" find where this file is being referenced, if you are using a local version be sure the path is correct, if not, be sure you are not recieving any JavaScript errors in IE due to cross domain file Interpretation or MIME errors.

这篇关于VideoJS无法在IE8中播放,但可以在FireFox,Chrome和Safari中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆