-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Video loading=lazy attribute support #10376
Comments
Huge fan of this, as it becomes more standard like Had this convo via Slack with @tunetheweb and others. Seems like logic could make multiple things happen as you describe:
It bugs me that JS is required to autoplay lazy loaded videos... :-/ |
/sub and +1 Went hunting for why video can't lazy load and found this. On my site nerdy.dev there is a lot of savings potential. I use |
cc @whatwg/media |
My previous comment about options: #6636 (comment) I suppose a reason to want lazy-loading for videos (over |
@argyleink : The closest thing to ideal that I have found (I did not create this, but cannot find who I pilfered from) is something like this for above-the-fold videos with "posters"...
And can then add:
And position the video over the picture with:
For below-the-fold:
Bit verbose, but gets the job done:
Massive kudos to whoever initially came up with this. |
What is the issue with the HTML Standard?
If the
video
element offered loading="lazy" support, that attribute could be used to determine how other desirable video features behave, such as when autoplay starts playing, and when its poster image and video file data are fetched.For example, loading=lazy combined with the autoplay attribute could cause a video to delay its poster image loading, its data fetching (other than metadata perhaps?), and its
autoplay
behavior until the video element is in (near) the viewport. Per my understanding, lazy autoplay is currently doable with JavaScript and it'd be great to offer a declarative HTML alternative.Could
<video loading="lazy" ..></video>
be one already-familiar way to offer a set of lazy behaviors for video?The text was updated successfully, but these errors were encountered: