Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 HTML5 video support

I'm having some trouble displaying HTML5 video in IE9, I added the different types to my htaccess

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm

This is what I have as html

<video id="video" autoplay loop preload>
            <source src="video/final_loop.mp4" type="video/mp4" />
            <source src="video/final_loop.webm" type="video/webm" />
            <source src="video/final_loop.ogg" type="video/ogg" />

            Your browser does not support the <code>video</code> element. 
        </video>

I also tried converting the video to Theora ogv format and use

<source src="video/final_loop.theora.ogv" type="video/ogv" />

But this doesn't work either, I thought .ogg was supported in IE9?

like image 766
woutr_be Avatar asked Oct 27 '11 08:10

woutr_be


People also ask

Why video is not playing in HTML5?

If your browser error "HTML5 video file not found", it means that your browser is not up to date or website pages does not have a suitable video codec. It would help if you communicated with the developer to solve the issue and install all the required codecs.

Does IE 8 support HTML5?

so the answer is that for all fits and purposes, IE8 does not support html5 - just some randome bits and pieces of it. Which makes using HTML5 (as in HTML markup, not scripting API's) moot. If you want HTML 5 support in IE 8 then download the IE plugin called "Chrome Frame".

Does IE support HTML5 video?

The strongest browser for HTML5 accessibility support is Internet Explorer (IE) version 10.

Can HTML5 play video?

HTML5 is the latest version of HTML. Unlike previous versions of HTML, HTML5 enables developers to easily add video to webpages with a video tag.


3 Answers

Internet Explorer 9 support MPEG4 using H.264 codec. But it also required that the file can start to play as soon as it starts downloading.

Here are the very basic steps on how to make a MPEG file that works in IE9 (using avconv on Ubuntu). I spent many hours to figure that out, so I hope that it can help someone else.

  1. Convert the video to MPEG4 using H.264 codec. You don't need anything fancy, just let avconv do the job for you:

    avconv -i video.mp4 -vcodec libx264 pre_out.mp4
    
  2. This video will works on all browsers that support MPEG4, except IE9. To add support for IE9, you have to move the file info to the file header, so the browser can start playing it as soon as it starts to download it. THIS IS THE KEY FOR IE9!!!

    qt-faststart pre_out.mp4 out.mp4
    

qt-faststart is a Quicktime utilities that also support H.264/ACC file format. It is part of libav-tools package.

like image 181
Gael Lafond Avatar answered Oct 27 '22 18:10

Gael Lafond


Are you trying to use this on IIS?

If so, you have to add the appropriate mime types to recognize your video files:

<configuration>
  <system.webServer>
    <staticContent>
      <!-- Video -->
      <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
      <mimeMap fileExtension=".webm" mimeType="video/webm"/>
    </staticContent>
  </system.webServer>
    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>

</configuration>

Here's some markup that works for me in IE9 (in the root folder, i have a "video" folder with my files):

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title>Video Demo</title>    
    </head>
    <body>
        <video id='movie'
            autoplay 
            controls
            loop 
            preload=auto
            playbackRate="1"
            width="800">
                <source src="video/video.mp4" type='video/mp4' /> 
                <source src="video/video.webm" type='video/webm' />
        </video>
    </body>

</html>
like image 23
Chris Ching Avatar answered Oct 27 '22 17:10

Chris Ching


As others have mentioned, IE9 doesn't support OGV, only MP4 and WebM (with plugin). I encountered a lot of trouble even with the MP4, which should play natively, before finding out that one thing to consider when serving MP4 files for IE9 is the file meta information called moov atom embedded in the MP4 file itself. If it's located at the end of the file, where some encoders including ffmpeg places it, IE9 will not start playing the video unless the whole video file downloaded. Relocating the moov atom metadata to the beginning of the file enables progressive download of the MP4 file, and IE9 handles the video nicely.

There's a tool called qt-faststart to perform this operation. Worked wonders for me, compiling and using the Linux command-line version distributed with ffmpeg.

make tools/qt-faststart
sudo cp tools/qt-faststart /usr/local/bin/
qt-faststart original_file.mp4 modified_file.mp4
like image 45
Viktor Avatar answered Oct 27 '22 17:10

Viktor