Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webm before or after mp4 in HTML5 video element?

Every tutorial/explanation I see out there that discusses HTML5 video format fallbacks use this type of markup as an example:

<video autoplay>  
  <source src="/myvideo.mp4" type="video/mp4">  
  <source src="/myvideo.webm" type="video/webm">  
  Sorry, your browser doesn't support HTML5 video.  
</video> 

So my question, why does everyone suggest to put the MP4 before the Webm format? If your browser supports Webm, it almost definitely supports MP4... The above markup essentially ensures that the more efficient Webm video will never be used, even though it has arguably better compression and will reduce bandwidth. Why is this?

Am I missing something about the way video fallbacks work?

like image 444
Jake Wilson Avatar asked Jan 05 '15 18:01

Jake Wilson


1 Answers

It has to do with backwards compatibility with iOS 3 devices. iPads running iOS 3 had a bug that prevented them from noticing anything but the first video source listed.

MP4 video type was the only supported video format, so if the mp4 version of the video is not the first source, it is ignored.

So, if you want to deliver video to iPad owners who haven’t yet upgraded iOS, you will need to list your MP4 file first, followed by the rest of the video formats.

Read more

like image 58
kolydart Avatar answered Sep 24 '22 17:09

kolydart