You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Poster images for videos outside viewport should be lazy-loaded #1591
changed the title [-]Poster image for videos outside viewport should be lazy-loaded[/-][+]Poster images for videos outside viewport should be lazy-loaded[/+]on Oct 15, 2024
As noted in #10 (comment), the video element's initial dimensions are set to match the poster image's intrinsic dimensions when no width and height are specified. However, if we are setting the width and height based on gathered client-side metrics, lazily-supplying the poster shouldn't cause any layout shift.
Activity
[-]Poster image for videos outside viewport should be lazy-loaded[/-][+]Poster images for videos outside viewport should be lazy-loaded[/+]westonruter commentedon Oct 15, 2024
As noted in #10 (comment), the
videoelement's initial dimensions are set to match theposterimage's intrinsic dimensions when nowidthandheightare specified. However, if we are setting thewidthandheightbased on gathered client-side metrics, lazily-supplying thepostershouldn't cause any layout shift.swissspidy commentedon Oct 16, 2024
This would be a big win. Even with
preload=none, the browser always downloads the poster image right now, even if it's way outside the viewport.