Bug 197608 - iOS Safari should support preload "auto"
Summary: iOS Safari should support preload "auto"
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari 12
Hardware: iPhone / iPad iOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5, InRadar
Depends on:
Blocks:
 
Reported: 2019-05-06 01:15 PDT by Terry
Modified: 2023-05-10 00:25 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Terry 2019-05-06 01:15:35 PDT
It is currently not possible to render the first frame of the video as the poster image on iOS Safari when using the native <video> element. Interestingly:

* macOS Safari renders the first frame without issue, probably because it automatically uses "auto" for preloading
* iOS Safari can render the first frame without issue if the video is autoplaying

However, if the video is not set to autoplay on iOS Safari, the first frame of the video is never fetched. Setting preload="auto" on the element does not work, as iOS Safari currently only supports the more restrictive "metadata" value when it comes to preloading: https://webkit.org/blog/6784/new-video-policies-for-ios/

When discussing with Jer Noble over Twitter, this was the response I've received from him:

> Loading, decoding, and displaying the first frame of video requires "preload=auto". But it’s ironic that a <video muted autoplay> gets "preload=auto" behavior and the arguably better behavior of non-autoplaying video doesn’t. Maybe it’s time to relax that restriction further.
Comment 1 Radar WebKit Bug Importer 2019-05-07 13:10:14 PDT
<rdar://problem/50552215>
Comment 2 Jer Noble 2019-05-07 13:44:08 PDT
If we can come up with a way of stopping media from downloading further once the first frame is available, this is a no-brainer.
Comment 3 Terry 2019-05-10 01:40:20 PDT
That would be very nice :) Android Chrome, for example, actually do perform the preloading but does not seem to request the entire video payload.
Comment 4 phil917 2023-05-04 22:04:41 PDT
It's 2023 and this is still an issue on iOS Safari. If a (muted) video is able to autoplay on page load, surely it makes sense to be able to load the first frame of a paused video.

Right now, it just looks broken if you add a video element that starts in a paused state, there's just a blank space where the video should be on the page on iOS Safari. Every other browser I've tested this on, including macOS Safari, does not have this issue.
Comment 5 phil917 2023-05-10 00:25:22 PDT
Just want to add for anyone that comes across this issue that you can "fix" this by using Media Fragments. Essentially, append #t=5 (or whatever time you want the video to start at) to your video src attribute. Works with .mp4 and (mercifully in my case) HLS sources.

This will cause the video to show a frame from the video source instead of a blank/empty space, if the video is loaded in the paused state.