4

IE9 is driving me CRAZY with it's support for HTML5 video, as far as I understand it, it supports the H.264 codec, so any files with a .mp4 extension on the end.

The problem is, it's not playing video files with a .mp4 extension . . .

It's even more unusual in that if I test it locally, IE9 will play the mp4 video, it just doesn't play it on the server, this is also nothing to do with MIME types, I added the following MIME type to the server:

.mp4 - video.mp4

And in the network panel in the IE developer tools, it's listing it's type as "video/mp4" the only unusual thing is that the Network panel shows IE is requesting it 3 times (I have no idea why this could be)

I'm at the end of my tether, so much so that I actually wrote the code below to try and fix it (I would really hate to use this on a live site, it's horrible):

    <!--[if !IE 9]><!-->
         <video controls="controls">
<!--<![endif]-->

<!-- This is a horrible way to do this, but I cannot figure out for the life of me why IE9 won't play this video :( -->
<!--[if !IE 9]><!-->
    <source src="video.ogv" type='video/ogg; codecs="theora, vorbis"'/>
    <source src="video.mp4" type="video/mp4">
<!--<![endif]-->

<!-- If HTML5 video is not supported, the following Flash video will play -->
<p>flash video stuff is here</p>

<!--[if !IE 9]><!-->
        </video>
<!--<![endif]-->

This fixes it by forcing IE9 to use the flash video for browsers that don't support HTML video (instead of doing this by default IE9 just seems to display a blank box, no error message, no anything). Unfortunately this solution is so horrible I'm almost ashamed to have written it.

Does anybody know what could be causing this? Or how I can fix it?

EDIT: Not sure if this is of any significance, but I used http://www.freemake.com/free_video_converter/ to convert the files to the correct formats

4

3 に答える 3

4

I'm running into the same problem. IE9 would play the video when you run the HTML file locally, but the thing stops working when you put it on the server. The problem must have something to do with the video file. You'd think that it can't be, given that it works locally. But that appears to be case. When I downloaded the sample video file at the VideoJS web site (http://vjs.zencdn.net/v/oceans.mp4) and put it into my own setup, IE9 plays it back just fine. So IE9 is somehow more picky when it plays a remote file.

I'll update this answer when I figure out what magic parameters are needed to make IE9 happy.

UPDATE: Okay, I think I figured it out. I spent some time comparing the MP4 file that works with the one that doesn't work. In the former, the random-access index ("stss" atom) is located near the beginning of the file. In the latter, it is located at the end of the file. Both locations are legal, but apparently IE9 is too stupid to look for it at the end of the file when it's downloading the file from the web.

The solution is to move the random-access index to the beginning of the MP4 file, using a tool that comes with ffmpeg: qt-faststart.

Note: I tried another tool: QTIndexSwapper. It seems to leave the file corrupted.

于 2013-05-26T17:19:42.117 に答える
1

I still have absolutely no idea what was causing this, I spent hours digging and digging and in the end asked someone else to try in their version of IE9, for some reason it worked on their computer and not mine.

I'm not entirely sure why, I'm just putting it down to my version of IE9 being broken in some way (which is frustrating considering how much time I spent trying to sort this out!)

于 2012-09-10T12:39:18.000 に答える
0

stackoverflowに答えがあります。

多分これはあなたにとって便利です:

HTML5-mp4ビデオはIE9では再生されません

これがお役に立てば幸いです...

于 2012-09-06T13:08:21.987 に答える