Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Video Element: Proposal for adding [srcset] + [posterset] + [sizes] on video element as well [posterset] on source elements #9812

Open
Schepp opened this issue Sep 29, 2023 · 5 comments
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@Schepp
Copy link

Schepp commented Sep 29, 2023

What is the issue with the HTML Standard?

In addition to re-implementing support for the media attribute on HTML video <source> elements as well as adding srcset and sizes attributes on HTML video <source> elements, this issue proposes additional support for srcset posterset and sizes attributes on the <video> element itself as well as individual posterset attributes on html <source> elements.

Use case:

While thanks to the techniques introduced by the RICG it is perfectly possible to present to the user agent a bunch of <img> source options to pick from, the same is not possible for a <video> element's poster image. That in turn either leads to a longer than needed loading time and a waste of resources, or to a quickly loading but blurry video poster image. If the video presents itself as the hero element, like on a video heavy site similar to YouTube, this totally ruins the LCP metric (or the visual appearance).

The combination of posterset and sizes attributes on the <video> element and a posterset attribute on <source> elements, working analogue to <picture>/<img>'s srcset and sizes attributes, would remedy that.

And finally, a srcset attribute on the <video> element could cover the easier use cases described in #9446 that otherwise would not require separate <source> elements (e.g. when there's just one file format available).

Related:

@Schepp Schepp changed the title HTML Video Element: Proposal for adding [posterset] + [sizes] on video element as well [posterset] on source elements HTML Video Element: Proposal for adding [srcset] + [posterset] + [sizes] on video element as well [posterset] on source elements Sep 29, 2023
@annevk

This comment was marked as off-topic.

@Schepp

This comment was marked as off-topic.

@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest labels Sep 30, 2023
@annevk

This comment was marked as off-topic.

@annevk
Copy link
Member

annevk commented Sep 30, 2023

cc @whatwg/media

@zcorpan
Copy link
Member

zcorpan commented Oct 3, 2023

Using a child img element as the video's poster image would enable srcset+sizes (and other features of img) for the poster image, see #6636 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

4 participants
@Schepp @zcorpan @annevk and others