Can a HTML 5 video tag have multiple MP4 sources with different codecs?

前端 未结 3 978
天涯浪人
天涯浪人 2021-01-17 14:45

I\'m thinking about the fact that the higher the MP4 profile we go, the better the video quality gets...

This brings me to a question I thought I\'d ask the experts!

3条回答
  •  孤街浪徒
    2021-01-17 15:01

    According to Mozilla, can contain an arbitrary number of tags. Also, the first source tag with a compatible video file for the current device/browser should be played.

    Apple themselves confirm that the tags should be in the developer's preferred fall-through order, from which I'd assume that Mobile Safari, too, will pick the first file it can play.

    So, from what I was able to dig up, there is no static way of preferring a particular file for a particular browser/device combination. You'd probably have to do some detection based on the provided User Agent string and only supply the proper files (but that's not possible with plain HTML).

提交回复
热议问题