Bug 239961

Summary: <video> poster attribute allows another video
Product: WebKit Reporter: Jeff Johnson <opendarwin>
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: eric.carlson, jean-yves.avenard, jer.noble, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Mac (Apple Silicon)   
OS: macOS 12   
Attachments:
Description Flags
Sample HTML reproduction none

Description Jeff Johnson 2022-05-02 05:15:14 PDT
Created attachment 458674 [details]
Sample HTML reproduction

The <video> poster attribute is supposed to be an image, but Safari allows and plays a video as the poster attribute. It's videos all the way down! And the poster video is auto-played (silently) even when Never Auto-Play is set in Safari's Auto-Play Preferences.

This bug only occurs in Safari. Chrome and Firefox do not show or play a poster video.

I'm testing with Safari Version 15.4 (17613.1.17.1.13) on macOS Version 12.3.1, M1 MacBook Pro.

Attached is a sample HTML file reproducing the issue.

I discovered this bug from an advertisement on cnn.com that wasn't respecting Safari's Auto-Play preferences, but I can't find the specific ad anymore.
Comment 1 Radar WebKit Bug Importer 2022-05-03 18:27:58 PDT
<rdar://problem/92705356>
Comment 2 Sam Sneddon [:gsnedders] 2022-05-04 07:16:56 PDT
There's two things here, I think:

1. Should a video be allowed a poster as a poster? (Which Dean mentioned on https://github.com/WebKit/explainers/issues/79!)

2. The poster video not obeying the site auto-play preference.

IMO, the latter is the more significant (and serious) issue, not least because it has the potential to actually cost the user real money.
Comment 3 Eric Carlson 2022-05-04 08:23:47 PDT
(In reply to Sam Sneddon [:gsnedders] from comment #2)
> There's two things here, I think:
> 
> 1. Should a video be allowed a poster as a poster? (Which Dean mentioned on
> https://github.com/WebKit/explainers/issues/79!)
> 

Safari, Firefox, and Chrome all allow animated .gif files as a <video> poster. From the user's perspective, what's the difference?

Only Safari allows a video file as a poster, but only WebKit allows a video file to be used as the source for an <img> element.


> 2. The poster video not obeying the site auto-play preference.
> 

Should an animated <img> also respect the user's auto-play preference?


> IMO, the latter is the more significant (and serious) issue, not least
> because it has the potential to actually cost the user real money.

A video file is generally smaller and more efficient to decompress, and therefore less expensive to download and display, than the same image sequence saved as an animated image.

I'm not necessarily saying that an animated poster makes sense, just that we shouldn't differentiate between using a video file and an animated image.

Should this be a spec issue?
Comment 4 Jeff Johnson 2022-05-04 08:59:21 PDT
(In reply to Eric Carlson from comment #3)
> (In reply to Sam Sneddon [:gsnedders] from comment #2)
> > There's two things here, I think:
> > 
> > 1. Should a video be allowed a poster as a poster? (Which Dean mentioned on
> > https://github.com/WebKit/explainers/issues/79!)
> > 
> 
> Safari, Firefox, and Chrome all allow animated .gif files as a <video>
> poster. From the user's perspective, what's the difference?

None. I wasn't aware that a poster frame would animate, but I've just confirmed this in testing.


> Only Safari allows a video file as a poster, but only WebKit allows a video
> file to be used as the source for an <img> element.

I definitely wasn't aware of this.


> > 2. The poster video not obeying the site auto-play preference.
> > 
> 
> Should an animated <img> also respect the user's auto-play preference?

Yes, absolutely. So many users are already annoyed by auto-playing animated gifs, it's astonishing that browser vendors haven't done anything to stop this. The fact that video files can be smaller in size and more efficient than gifs will just encourage web developers to abuse the capability.

Seriously, if Safari shipped click-to-play animated gifs, you might get more public praise than you've ever heard in your life.