HTML5 - mp4 video does not play in IE9

前端 未结 13 2203
一生所求
一生所求 2020-11-27 05:08

I have an mp4 video that I want to play in IE9 using HTML5 tag. I added the MIME type to IIS 7 so if I browse http://localhost/video.mp4

13条回答
  •  盖世英雄少女心
    2020-11-27 05:44

    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.

提交回复
热议问题