whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.18k stars 2.71k forks source link

HTML Video and its Source Elements Should Support SRCSET and SIZES #10379

Open scottjehl opened 6 months ago

scottjehl commented 6 months ago

What is the issue with the HTML Standard?

Now that video allows for sources that offer different media attributes, there's nice parity with the way the picture element behaves. However, the video element and its source elements only support the src attribute, unlike img and the picture element's source elements which support srcset and sizes.

Support for srcset and sizes attributes would allow developers to deliver video based on conditions the browser knows best. It would offer a resolution based delivery for cases where art direction is less important.

This is a proposal for both:

<video srcset="..." sizes="...">

and

<video>
<source srcset="..." sizes="...">
</video>

Thanks!

annevk commented 3 months ago

cc @whatwg/media