HTML5视频不能在IE9 + 10中使用 [英] HTML5 Video Not Working in IE9+10

查看:145
本文介绍了HTML5视频不能在IE9 + 10中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在多个浏览器上使用HTML5视频制作图片横幅广告。我在大多数操作系统上都可以在Chrome和Firefox上使用这个视频,但是Internet Explorer似乎不能在IE9上面工作。横幅所在的页面不存在于与视频文件相同的文件夹中;横幅在许多页面上存在。

我可以看到的问题是,IE9和10无法在视频HTML5代码中看到Flash后备选项,并且不会注册。我想创建一些if-else语句,强制使用IE9或10的用户查看Flash版本,同时将所有其他浏览器重定向到一般的HTML5版本。此横幅广告适用于以下版本,包括IE8。

我没有访问.htaccess文件;我看到这个建议在其他地方,以手动添加MIME类型(甚至在我指定它在每个视频源行)后,我看着在IE9 + 10的控制台,看看是否MIME类型是一个问题,没有错误向上。右键单击视频的空间也给了我HTML5的视频选项,但点击播放什么都没有。

如果有人可以帮我调试代码或找出一个如果要让它工作,那将会很棒。谢谢!
以下是我使用的HTML5视频代码,适用于Chrome,Firefox和其他浏览器。

 <视频自动播放循环> 
< source src =http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar_Banner.mp4type =video / mp4>
< source src =http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar_Banner.ogvtype =video / ogg>
< source src =http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/FlashFulmar Slideshow.webmhd.webmtype =video / webm >
< param name =movievalue =http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar%20Banner.swf/>
< / object>
< / video>

编辑:mp4文件的编解码器是h.264 + AAC。 > IE 9+支持h264与mp3 / aac,vp8和vp9是有问题的,所有其他人似乎并不支持。



关于媒体浏览器兼容性的MDN文档

您将不得不提供多个视频源来支持每个浏览器,但不一定是每个浏览器的视频,因为一些浏览器在支持上有重叠。



提供视频用h264 aac / mp3应该在IE,Safari和Chrome上播放。
使用Theora或VP8的视频应在Firefox和Opera上播放


I'm trying to make an image banner using HTML5 video across multiple browsers. I have the video working in Chrome and Firefox across most operating systems, but Internet Explorer does not appear to work above IE9. The page where the banner is located does not exist in the same folder as the video files; the banner exists across many pages.

The problem that I can see is that IE9 and 10 cannot see the Flash fallback option within the Video HTML5 code and it doesn't register. I wanted to create some sort of if-else statement that would force users who are using IE9 or 10 to view the Flash version while redirecting all other browsers to the general HTML5 version. This banner works in versions below and including IE8.

I do not have access to the .htaccess file; I saw this suggested somewhere else in order to manually add the MIME type (even after I specified it within each video source line.) I looked at the console in IE9+10 to see if the MIME type was an issue, and no error came up. Right-clicking the space where the video came up also gave me HTML5 video options, but clicking Play did nothing.

If someone can help me debug the code or figure out a wa y to make it work, that would be great. Thank you! Below is the HTML5 video code that I am using that works across Chrome, Firefox and other browsers.

<video autoplay loop>
<source src="http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar_Banner.mp4" type="video/mp4">
<source src="http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar_Banner.ogv" type="video/ogg">
<source src="http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/FlashFulmar Slideshow.webmhd.webm" type="video/webm">
<object width="954" height="224" type="application/x-shockwave-flash" data="http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar%20Banner.swf">
    <param name="movie" value="http://fulmar.mahopac.k12.ny.us/www/mcsd_FR/site/hosting/Fulmar%20Banner/Fulmar%20Banner.swf" />
</object>
</video>

Edit: The codec for the mp4 file is h.264 + AAC.

解决方案

IE only supports a limited set of codecs for video sources

IE 9+ supports h264 with mp3/aac, vp8 and vp9 are questionable, all others it does not seem to support.

MDN doc on media browser compatibility

So you will have to provide several video sources to support each browser, but not necessarily a video for each browser as some of the browsers do overlap in their support.

Providing a video with h264 aac/mp3 should play on IE, Safari, and Chrome. While a video with Theora or VP8 should play on Firefox and Opera

这篇关于HTML5视频不能在IE9 + 10中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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