Skip to content

Lazy video poster never loads when no media fetch is parked #13083

Open

Description

@zcorpan

The poster frame steps park the poster fetch without starting to observe the element:

  1. If the will lazy load element steps given the video return true:
    1. Let posterResumptionSteps be the rest of this algorithm starting with the step labeled Fetch.
    2. Set the video element's poster lazy load resumption steps to posterResumptionSteps.
    3. Return.

The only caller of start intersection-observing a lazy loading element for media is the resource fetch algorithm, so the poster only loads if a media resource fetch happens to be parked at the same time. It isn't in these cases:

  • <video loading=lazy poster=p.jpg> with no src and no source children: resource selection returns before the resource fetch algorithm, so the poster never loads.
  • <video loading=lazy poster=a.jpg src=v.mp4>, scrolled into view and then poster set to b.jpg: the lazy load intersection observer callback already stopped observing the element, so b.jpg never loads.

Maybe step 6 should also start intersection-observing the element? That's a no-op if it's already observed.

cc @scottjehl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions