whatwg / html

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

HTML Video: Allow a child Picture Element to Control the Video Poster Image #10378

Open scottjehl opened 4 months ago

scottjehl commented 4 months ago

What is the issue with the HTML Standard?

The video element currently offers a single poster attribute, which allows us to load one poster image source. This is limiting when attempting to deliver an appropriate poster image size depending on browsing conditions. It would be better if multiple sources could be offered to the browser to display based on varying conditions, as several other issues have mentioned.

Some of those conditions are:

To expand on that last point: now that the video element allows for "responsive" source elements that use media attributes, developers can offer video sources based on media conditions like orientation, pixel density, and more.

Some proposals have suggested attributes to expand our ability to reference poster image sources, but attributes alone could be limited in trying to address even the cases listed above.

Allowing a picture element inside the video element could be a way to offer all of the various use cases that a poster image may need to cover. (This idea was first pointed out here I believe: https://github.com/whatwg/html/issues/6636#issuecomment-1747375460 )

Thanks!

scottaohara commented 4 months ago

reminder that allowing for this would then make providing alt text for the posters doable, and thus could close https://github.com/whatwg/html/issues/7954