Skip to content

Poster images for videos outside viewport should be lazy-loaded #1591

Description

@westonruter

When a VIDEO with a poster is outside the viewport, the poster image will be downloaded with a medium priority even though the element is not visible:

Image

This being the case, the poster should ideally be lazy-loaded when the video nears the viewport using IntersectionObserver.

Related:

Activity

  1. moved this to Not Started/Backlog 📆 in WP Performance Ongoingon Oct 15, 2024
  2. 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
  3. westonruter commented on Oct 15, 2024

    @westonruter
    MemberAuthor

    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.

  4. swissspidy commented on Oct 16, 2024

    @swissspidy
    Member

    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.

  5. self-assigned this
    on Oct 16, 2024
  6. moved this from Not Started/Backlog 📆 to Code Review 👀 in WP Performance Ongoingon Oct 16, 2024
  7. moved this from Code Review 👀 to Done 😃 in WP Performance Ongoingon Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Plugin] Image PrioritizerDependent on Optimization Detective (optimization-detective) [slug: image-prioritizer][Plugin] Optimization Detective[slug: optimization-detective][Type] EnhancementA suggestion for improvement of an existing feature

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions