Skip to content

Conversation

@scottjehl
Copy link

@scottjehl scottjehl commented Dec 2, 2025

Specify support for the loading attribute for the video element using similar conventions to img and iframe, where the attribute already has precedent. Loading has possible values of eager and lazy. When the video element's loading attribute value is lazy, loading of any video or poster image data, as well as autoplay playback, must defer until layout is known and the video is in the viewport.

Resolves #10376

(See WHATWG Working Mode: Changes for more details.)


/acknowledgements.html ( diff )
/indices.html ( diff )
/media.html ( diff )
/urls-and-fetching.html ( diff )

Specify support for the loading attribute for video using similar conventions
to img and iframe, where the attribute has precedent. It has possible values
of eager and lazy. When the loading attribute value is lazy, loading of any
video or poster image data, as well as autoplay playback, must defer until
layout is known and the video is in the viewport. This commit contains examples
for how the loading attribute should take precedence over the preload, poster,
and autoplay attributes. These were informed by experiments with local patch
implementations to several user agents.
@annevk annevk added addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest topic: media needs tests Moving the issue forward requires someone to write tests labels Dec 4, 2025
@annevk
Copy link
Member

annevk commented Dec 4, 2025

cc @whatwg/media

@foolip
Copy link
Member

foolip commented Dec 9, 2025

This direction makes sense to me, but I'm not personally able to make a commitment to implement in Chromium.

@zcorpan I think you've mentioned this feature, perhaps you have feedback?

Add detail for video element lazy loading behavior when loading state is lazy.
This involves returning early to prevent poster and video data loading and
defining resumption steps to resume when loading state changes to eager. Also
includes notes about autoplay eligibility and precedence over the preload attribute.
Adjust language of this statement about precedence of the loading
attribute over the preload attribute so that it reiterates a fact.
Remove mention as audio is not mentioned in this proposed attribute addition
scottjehl added a commit to Squarespace/wpt that referenced this pull request Jan 7, 2026
…g attribute

These tests support the proposal for the addition of a loading attribute
on the video element, designed to enable lazy-loading for video and poster
data. HTML Standard PR here whatwg/html#11980

Co-authored-by: Zach Lysobey <[email protected]>
Co-authored-by: Brad Frost <[email protected]>
Co-authored-by: Credo Duarte <[email protected]>
@scottjehl
Copy link
Author

Added and linked up a PR with web platform tests web-platform-tests/wpt#57051

small note: it says my entity is unverified above, but I think it's registered correctly now and needs a check

@zcorpan zcorpan removed needs implementer interest Moving the issue forward requires implementers to express interest needs tests Moving the issue forward requires someone to write tests labels Jan 14, 2026
@scottjehl scottjehl requested a review from zcorpan January 14, 2026 17:41
@zcorpan
Copy link
Member

zcorpan commented Jan 15, 2026

@scottjehl I tried to push changes to this branch but was denied. Can you enable "Allow edits from maintainers"?

@scottjehl
Copy link
Author

@zcorpan I looked into how to do that and it sounds like the option may not be available for forks made by an organization, such as this one. Any other way we can help? Perhaps if the changes are in a public fork of yours I could pull them from there?

@zcorpan
Copy link
Member

zcorpan commented Jan 16, 2026

@scottjehl OK, pushed to https://github.com/zcorpan/html/tree/video-loading-attribute

@scottjehl
Copy link
Author

@zcorpan looked great, thanks. Merged here!

@smaug----
Copy link

Is there a reason why lazy loading affects video element only, but not HTMLAudioElement?

@scottjehl
Copy link
Author

scottjehl commented Jan 18, 2026 via email

@smaug----
Copy link

Wouldn't it be easier (and would also keep things more consistent) if this was dealing with media element from the beginning?

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 topic: media

Development

Successfully merging this pull request may close these issues.

Video loading=lazy attribute support

5 participants