如何在IE8浏览器中播放html5视频

时间:2011-08-03 06:29:53

标签: html5-video telerik-mvc asp.net-mvc-3

我已经开发了一个MVC3应用程序,因为我在运行应用程序时使用html5视频控件它在Chrome中播放但是当我尝试在IE8浏览器中播放时它不播放视频只是它只显示白页。 ..如何在所有浏览器中播放视频请帮助我..

这是我在我的页面中所做的代码

<video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg"
    width="640" height="360">
    <source src="../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.mp4" type="video/mp4" />
   <%-- <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm" />--%>
    <source src="../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.ogv" type="video/ogv" />
    <object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf"
        width="640" height="360">
        <param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
        <param name="allowFullScreen" value="true" />
        <param name="wmode" value="transparent" />
        <param name="flashVars" value="config={'playlist':['http%3A%2F%2Fsandbox.thewikies.com%2Fvfe-generator%2Fimages%2Fbig-buck-bunny_poster.jpg',{'url':'../../Videos/Nenu Nuvvuantu - Orange - MyInfoland.mp4','autoPlay':false}]}" />
        <img alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg"
            width="640" height="360" title="No video playback capabilities, please download the video below" />
    </object>
</video>

3 个答案:

答案 0 :(得分:40)

使用闪存和其他后备设置HTML5视频有一个很好的标准方法。

请参阅Video for Everybody,了解带有后备选项的HTML5标签生成器。

或者,这是another great library, with JS/CSS code to make it work consistently

答案 1 :(得分:0)

我使用以下方法来解决IE的播放问题,这对我有用。

<video id=0 controls width="640" height="360">
<source src="new/db.ogv" type='video/ogg; codecs="theora, vorbis"'/>
<source src="new/db.webm" type='video/webm' >
<source src="new/db.mp4" type='video/mp4'>
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="500" height="500">
  <param name="movie" value="db.swf">
  <param name="quality" value="high">
  <param name="wmode" value="opaque">
  <param name="swfversion" value="11.0.0.0">
  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
  <param name="expressinstall" value="../../Scripts/expressInstall.swf">
  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
  <!--[if !IE]>-->
  <object type="application/x-shockwave-flash" data="db.swf" width="500" height="500">
    <!--<![endif]-->
    <param name="quality" value="high">
    <param name="wmode" value="opaque">
    <param name="swfversion" value="11.0.0.0">
    <param name="expressinstall" value="../../Scripts/expressInstall.swf">
    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
    <div>
      <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
    </div>
    <!--[if !IE]>-->
  </object>
  <!--<![endif]-->
</object>

</video>

<script type="text/javascript">swfobject.registerObject("FlashID");</script>
<script src="../../Scripts/swfobject_modified.js" type="text/javascript"></script>
  

//你可以在这里下载swfobject_modified

http://code.google.com/p/fanarshavin/downloads/detail?name=swfobject_modified.js&can=2&q=

答案 2 :(得分:-1)

我无法在IE8中使用JWPlayer在页面上切换视频。而且,它的JS API在IE8中不起作用。 还有顶级玩家:medialement,VideoJS,SublimeVideo。所以,我现在正在尝试使用mediaelement。