[whatwg] Interpretation of video poster attribute

Ian Hickson ian at hixie.ch
Fri Jun 13 02:26:56 PDT 2008

On Thu, 12 Jun 2008, Philip Jägenstedt wrote:
> <video poster="image_of_unknown_dimension" 
> src="video_of_unknown_but_same_dimension"></video>
> This is a probable and reasonable scenario, but currently it's 
> impossible to use a poster image without knowing its dimensions.

It's not impossible; first black would render 300x150, then the poster 
would render in that same 300x150 box, and then when the video comes in, 
the box would grow to fit the video and the video would render in that 
box. The poster works fine, it just doesn't size the video box to itself.

How often will the poster be the right size?

I suppose we could require the poster to be the same size as the video if 
the height/width attributes are absent.

> > > That the element may be resized twice is not a problem, at least not 
> > > implementation-wise.
> > 
> > That it's resized at all is a terrible problem; that it would resize 
> > twice would be a disaster, UI-wise.
> Since the poster image will only be displayed until the video starts 
> playing, the options when width/height is not given are:
> 1. the poster image is displayed at size 300x150 for several seconds 
> while the video is loading, after which the video element takes the size 
> of the video
> 2. the poster image is displayed at its native size for several seconds 
> while the video is loading, after which the video element takes the size 
> of the video (which will often be the same size)
> Since a resize is possible in both cases (but less likely in case 2)
> both are equally problematic UI-wise, except that the image will
> actually be displayed with its correct dimensions in case 2.

Both cases will start at 300x150 until the poster frame is downloaded. The 
question is whether we get one resize or two.

> This is just to provide sane defaults for authors who trust the browser 
> to do the right things in absence of width/height. Safari already uses 
> the intrinsic dimensions of the poster image and then resizes to the 
> intrinsic dimensions of the video, which is exactly the behavior we want 
> to implement.

On Thu, 12 Jun 2008, Chris Double wrote:
> This is the behaviour I was planning to implement for poster too btw. As 
> a user of the video element it seemed the most logical to me.

Fine, fine, I'll spec that. :-)

Note that this all falls apart if there are multiple videos of different 
dimensions, or if the video has a pixel ratio set.

> In the absence of a poster attribute does Safari load the first frame of 
> the video and display that? I seem to recall it did when using a 
> quicktime movie but not with a Theora movie using the XiphQT plugin. Is 
> displaying the first frame of the video something that's useful? In the 
> Firefox implementation I display the first frame, but I should be 
> displaying nothing, right?

When a video element is paused and the current playback position is the 
first frame of video, the element represents either the frame of video 
corresponding to the current playback position or the image given by the 
poster attribute, at the discretion of the user agent.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list