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

前端 未结 3 1008
天涯浪人
天涯浪人 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:05

    You can provide several source tags and the user agent should play the first one it can handle.

    See W3C definition: http://www.w3.org/TR/html5/embedded-content-0.html#the-source-element

    There also a javascript example for fallbacks is presented.

    http://www.w3.org/TR/html5/embedded-content-0.html#mime-types shows some javascript how you can test if a browser can play a specific codec.

提交回复
热议问题