Reputation: 29186
I have the following in a .html file:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Testing</title>
</head>
<body>
<video id="0" controls width="502" height="479">
<source src="vid1.webm" type='video/webm'>
<source src="vid1.mp4" type='video/mp4'>
<p>Video is not visible, most likely your browser does not support HTML5 video</p>
</video>
</body>
</html>
When I open the html file in IE9 I see the video and I can play it, no problem.
Now, I have the same html inside a web page that runs in a site hosted on my local IIS 7.5. When I view the webpage no video is shown at all, the page is blank. I've added the following to the web.config file:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
</staticContent>
When I view the MIME types in the website setting in IIS, all of the above are listed, so it's picked them up no problem.
I'm stuck now as I can;t see why IE9 won't play the video. Both FireFox and Chrome display the video without any hassle, so why (yet again) does IE have to be the odd one out? :)
Could someone help me out please?
Edit: In response to Bart's comment, here is the profiler output when I requested the page:
http://localhost/Rest/test.html GET 304 text/html 161 B < 1
/Rest/vid1.mp4 GET 200 video/mp4 32.24 KB 125 ms
/Rest/vid1.mp4 GET 206 video/mp4 80.91 KB 15 ms
/Rest/vid1.mp4 GET 200 video/mp4 144.20 KB 1.04 s
Edit:
I checked the format of the MP4. Basically I used Freemake to convert an AVI file into a MP4, using the default preset "Same a source : H.264, AAC original size". So as far I'm aware, the MP4 file is H.264 format.
AS I mentioned, IE9 will display the file when opening the HTML file, but when running under IIS, it doesn't like it.
Edit I followed the instructions given in this post : http://blogs.msdn.com/b/thebeebs/archive/2011/07/20/html5-video-not-working-in-ie9-some-tips-to-debug.aspx to dump out any error codes from the video element. Here is what I got:
MEDIA_ERR_DECODE 3
People tend to reflect this as
An error of some description occurred while decoding the media resource, after the resource was established to be usable.
Does anyone know what I'm supposed to do in response to this?
Upvotes: 1
Views: 3146
Reputation: 3893
You probably do not have the mime type setup in IIS. You have to manually set the file types up before IIS will serve content like videos, pdf, etc. It is a security best practice thing.
Upvotes: 1