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
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 needs tests Moving the issue forward requires someone to write tests topic: media

Development

Successfully merging this pull request may close these issues.

Video loading=lazy attribute support

4 participants