Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 Video Error - Internet Explorer 9

I am trying to get a .m4v video to play in IE9 using html5 video tags. When I play the video from a remote location it works fine:

<video src="http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer_480x270_h264aac.m4v" controls="controls">
</video>

But when I want to play it from my server...

<video src="Big_Buck_Bunny_Trailer_480x270_h264aac.m4v" controls="controls">
</video> 

...it only works in Chrome and not in IE9.

What could cause the video not to play when located on my server?

Many thanks,

Chris

like image 767
Kit Avatar asked Apr 25 '26 17:04

Kit


2 Answers

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?

like image 152
Kit Avatar answered Apr 30 '26 17:04

Kit


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
like image 26
user884457 Avatar answered Apr 30 '26 17:04

user884457