Page MenuHomePhabricator

Make a/v preload metadata
Open, Needs TriagePublic

Description

Proposing to set most audio and video elements to use preload=metadata. Preload is a user-agent hint which allows the user agent to optimise the video playback experience.

none: With none as we have currently, no part of the video stream is ever touched before play is pressed and only the poster is retrieved. This is efficient for network usage, but also introduces significantly delay AFTER pressing play, as essential information to play back the stream still needs to be fetched from a server before playback can begin.

auto: The default, which not only downloads the essential information but also allows the user agent to retrieve part of the start of the stream, to avoid having to wait for any buffering, for as many videos on the page as it deems necessary.

metadata: only retrieves the essential information like stream type info, length etc.

Additional, we know:

  • When DataSaver is enabled, Chrome downgrades preload to none
  • When cellular connection is used, Chrome downgrades preload auto to metadata (so setting auto makes no difference)
  • When iOS or iPadOS is used, Safari downgrades a preload auto to metadata.

I'm proposing to set normal inclusions of video to preload="none". EXCEPT on Category and Special namespaces, where we often can have well over a dozen of videos on a single page. This should allow faster interactions for most users, because some video information is prefetched AFTER DOMContentLoaded. I think that will lead to a better user experience, at a reasonable increase in network usage, esp considering the optimisations that web browsers have made in the last 10 years wrt resource fetching.