最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Video is not working in IE - Stack Overflow

programmeradmin9浏览0评论

I am using following code to show video on my website. It is working perfect in Firefox and Google Chrome but not working in IE.

<video class="video-js" width="278" height="165" controls preload>

    <source src="/uploads/video/encoding/mp4/<?php echo $video->getId() ?>.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
    <source src="/uploads/video/encoding/ogg/<?php echo $video->getId() ?>.ogg" type='video/ogg; codecs="theora, vorbis"' />

    <object id="flash_fallback_1" class="vjs-flash-fallback" width="278" height="165" type="application/x-shockwave-flash" data=".2.1.swf">

      <param name="movie" value=".2.1.swf" />
      <param name="allowfullscreen" value="true" />
      <param name="flashvars" value='config={"playlist":[".png", {"url": ".mp4","autoPlay":false,"autoBuffering":false}]}' />

    </object>

</video>

I searched for that but not succeeded yet. Is there any programing solution of this without installing any third party plugin on IE.

Thanks

I am using following code to show video on my website. It is working perfect in Firefox and Google Chrome but not working in IE.

<video class="video-js" width="278" height="165" controls preload>

    <source src="/uploads/video/encoding/mp4/<?php echo $video->getId() ?>.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
    <source src="/uploads/video/encoding/ogg/<?php echo $video->getId() ?>.ogg" type='video/ogg; codecs="theora, vorbis"' />

    <object id="flash_fallback_1" class="vjs-flash-fallback" width="278" height="165" type="application/x-shockwave-flash" data="http://releases.flowplayer/swf/flowplayer-3.2.1.swf">

      <param name="movie" value="http://releases.flowplayer/swf/flowplayer-3.2.1.swf" />
      <param name="allowfullscreen" value="true" />
      <param name="flashvars" value='config={"playlist":["http://video-js.zencoder./oceans-clip.png", {"url": "http://video-js.zencoder./oceans-clip.mp4","autoPlay":false,"autoBuffering":false}]}' />

    </object>

</video>

I searched for that but not succeeded yet. Is there any programing solution of this without installing any third party plugin on IE.

Thanks

Share Improve this question asked Jan 3, 2012 at 15:35 AwanAwan 18.6k38 gold badges93 silver badges133 bronze badges 4
  • the code you wrote seems working correctly... have you installed flash plugin for IE? – Fabrizio Calderan Commented Jan 3, 2012 at 15:39
  • I did not check this. How can I check this ? – Awan Commented Jan 3, 2012 at 15:42
  • Saying the version of IE is always important. What version are you testing with IE 6,7,8,9,10? – epascarello Commented Jan 3, 2012 at 15:42
  • 1 just copied the <object>...</object> snippet into jsfiddle. The video is correctly loaded. Since IE<9 doesn't recognize <video> and <source> elements it will try to render the object as a fallback. – Fabrizio Calderan Commented Jan 3, 2012 at 15:44
Add a ment  | 

5 Answers 5

Reset to default 5

Older versions of ie before ie9 don't support html5.

Use embed as a fallback.

HTML5 is not supported by versions that came before IE9. Therefore, the video tag is not recognized. The object tag was introduced in HTML 4, but some earlier versions of IE either had bugs with it or did not support it at all.

In short, you need to create a fallback with the proprietary <embed>...</embed> tag instead of <object>...</object>.

OR

A better solution would be to use the HTML5shiv which creates the HTML5 elements through JavaScript for the previous versions of IE.

You would have to place the following in your head section:

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode./svn/trunk/html5.js"></script>
<![endif]-->

You can view some interesting explanations and other useful tools on NetTuts+.

Only IE 9+ supports the html5 video tag.

http://msdn.microsoft./en-us/ie/hh410106

Out of the IE browsers only IE9 supports the video tag, make sure you use that version to test it, or you'll have to use fallbacks. All other recent browser support it, but check the link to see from which versions exactly.

For IE browsers, you can make use of video4all.

发布评论

评论列表(0)

  1. 暂无评论