Webm before or after mp4 in an HTML5 video element?

Each tutorial / explanation that I see where HTML5 backup options are discussed uses 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 is: why does everyone suggest putting MP4 in front of the Webm format? If your browser supports Webm, it almost certainly supports MP4 ... The aforementioned markup essentially guarantees that more efficient Webm video will never be used, although it may improve compression and reduce bandwidth. Why is this?

Am I missing something about how video backups work?

+5
source share
1 answer

This is due to backward compatibility with iOS 3. devices. IPads running on iOS 3 had an error that prevented them from noticing anything other than the first video source.

The 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 the video to owners of the iPad who have not yet updated iOS, you first need to specify your MP4 file, and then the rest of the video formats.

More details

+4
source

Source: https://habr.com/ru/post/1210420/


All Articles