[whatwg] Interpretation of video poster attribute
ian at hixie.ch
Thu Jun 12 00:15:39 PDT 2008
On Tue, 3 Jun 2008, Philip Jägenstedt wrote:
> I'm a bit puzzled about how to interpret the poster attribute on
> "The poster attribute gives the address of an image file that the user
> agent can show while no video data is available. The attribute, if
> present, must contain a URI (or IRI)."
> Is the intention that this image should be stretched to the size of the
> video element, or that it should be centered in the frame?
Technically that's up to the UA. However, the spec says of <img> that "An
img element represents an image" and says of <video> that "When no video
data is available (the element's networkState attribute is either EMPTY,
LOADING, or LOADED_METADATA), video elements represent either the image
given by the poster attribute, or nothing".
So, to summarise, an <img> represents its src="", and a <video> represents
its poster="". So use the same mechanism (stretching the image to fit the
box dimensions) for both.
> If the width and height attributes are not given, should the video
> element initially be given the size of the poster image, or should the
> user agent wait until it has the dimensions of the video (thereby making
> the poster useless)?
This isn't currently defined (even without a poster, as far as I can
tell), but my intention would be to not make the poster affect the
intrinsic dimensions, and for the default, in the absence of video data,
(Both of these questions will likely get answered to some extent in the
rendering section, hopefully.)
On Tue, 3 Jun 2008, Tab Atkins Jr. wrote:
> Just for similar-implementation-ideas, flvplayer simply aligns the
> poster image to the upper-left of the object element, with no scaling at
> all. If width and height are not given, it simply doesn't display at
> Unless there's already some alternate intent, I suggest <video> scale to
> the poster's size if no explicit size is given.
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).
On Mon, 9 Jun 2008, Philip Jägenstedt wrote:
> http://lists.w3.org/Archives/Public/public-html/2007Oct/0108.html it is
> clear that the intention of the poster attribute is to represent a still
> image from the video. This should probably be made explicit in the spec
> with something in the style of:
> The poster image typically represents a still frame of video.
This will be covered by an introduction section in due course, I expect.
> User agents must (may?) take this into account by applying the same
> rules as for rendering video (aspect ratio correction, scaling,
Should aspect ratio correction be done for poster images? What if
different videos have different aspect ratios? It would be bad for the
poster frame to be rendered at different ratios as the UA tries each video
> HTTP 4xx and 5xx errors (and equivalents in other protocols) must (may?)
> cause the user agent to ignore the poster attribute.
Well what else are they going to do? HTTP already requires this as far as
I can tell.
> This needs to be clear as there are two quite natural interpretations of
> what kind of image "the user agent can show while no video data is
> available". The first is an unscaled, centered "click to play" button,
> while the second is a scaled, centered and aspect ratio corrected still
> frame from the video.
I'm not sure a fake button (which wouldn't actually work anyway) is a
natural interpretation of "poster frame". :-)
Ian Hickson U+1047E )\._.,--....,'``. fL
http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,.
Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
More information about the whatwg