Intent to Prototype: Lazy loading for video and audio elements

42 views
Skip to first unread message

Helmut Januschka

unread,
1:58 PM (3 hours ago) 1:58 PM
to blink-dev
Contact emails
hjanu...@gmail.com

Explainer
https://github.com/whatwg/html/pull/11980
https://chromium-review.googlesource.com/c/chromium/src/+/7511253
https://issues.chromium.org/issues/469111735

Specification
https://github.com/whatwg/html/pull/11980

Summary
Adds the loading attribute to <video> and <audio> elements, allowing developers to defer media resource loading until the element is near the viewport using loading="lazy". This matches the existing lazy loading behavior for <img> and <iframe> elements, improving page load performance and reducing data usage. CL: https://chromium-review.googlesource.com/c/chromium/src/+/7511253

Blink component
Blink>Media

Web Feature ID
Missing feature

Motivation
Web developers frequently need to defer loading of video and audio resources to improve page load performance and reduce data usage, especially on pages with multiple media elements below the fold. Without native support, developers must implement custom JavaScript solutions using Intersection Observer to detect when media elements enter the viewport and then dynamically set the src attribute. This approach is error-prone, adds complexity, and cannot integrate with the browser's preload scanner. The loading attribute already exists for <img> and <iframe> elements, and developers expect the same declarative API for media elements. Native lazy loading allows the browser to optimize resource loading with network-aware thresholds, properly handle the interaction with autoplay and preload attributes, and avoid blocking window.onload for offscreen media.

Initial public proposal
https://github.com/whatwg/html/pull/11980

Requires code in //chrome?
False

Tracking bug
https://issues.chromium.org/issues/469111735

Measurement
UseCounters should be added to track adoption

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status
https://chromestatus.com/feature/5200068565139456?gate=5103036932423680

This intent message was generated by Chrome Platform Status.

Rick Byers

unread,
4:16 PM (28 minutes ago) 4:16 PM
to Helmut Januschka, blink-dev
Cool, makes sense to me! Thanks for working on it Helmut!

Rick 

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFmjHKSFVWGyOWV%2BKymVmsaro9YbXoN5YYGbnNpnLo1KLe4dCQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages