[whatwg] Interpretation of video poster attribute

Philip Jägenstedt philipj at opera.com
Thu Jun 12 03:36:43 PDT 2008


On Thu, 2008-06-12 at 09:56 +0000, Ian Hickson wrote:
> > > The problem with scaling to the poster's size is that it would make 
> > > the veo resize twice e (300x150 -> poster -> video) instead of just 
> > > once (300x150 blank, then poster -> video).
> > 
> > If poster is to <video> what src is to <img>, then surely the video 
> > element should take the size of the poster image if no width/height is 
> > given? This is certainly my preference, as width/height would otherwise 
> > effectively be mandatory when poster is used, which would in turn 
> > require the poster to be of the same size as the video unless one is to 
> > be scaled.
> 
> Why? The posted would be displayed in the default 300x150 box.

<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.

> > 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 woul 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.

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.

-- 
Philip Jägenstedt
Opera Software




More information about the whatwg mailing list