HTML5 Video Error - Internet Explorer 9

混江龙づ霸主 提交于 2019-11-29 00:40:50

In addition to needing the server to send the correct Content-Type header for the requested video file itself, you should consider using a child <source> tag instead of the src attribute, eg:

<video controls="controls">
<source src="Big_Buck_Bunny_Trailer_480x270_h264aac.m4v" type='video/x-m4v; codecs="..."'>
</video> 

That will allow you to specify up-front the actual video type information so the browser can decide whether to even download the file at all. As well as give you flexibility to offer additional video types later on, if desired.

I have found the problem. IE9 RC was seeing the video as plain/text and not video/m4v so it was not able to play. Chrome and IE8 read the file correctly.

Adding AddType video/x-m4v .m4v to my htaccess made sure IE9 RC was able to read it as a video/mp4 file.

Crazy eh?

user884457

In order for your server to associate the correct MIME types with the application, you will need to include the MIME types into your htaccess file.

Here is an example of several MIME types that you can include within your .htaccess file:

#Video MIME Types:
AddType video/m4v .m4v
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!