W3C home > Mailing lists > Public > public-html@w3.org > December 2012

Re: Questions about the video element

From: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
Date: Sat, 15 Dec 2012 21:02:20 +1100
Message-ID: <CAHp8n2msFSaUKq2WWxH6D2Mp2W=LF2jUwmm7=XFW8K7UxY04yg@mail.gmail.com>
To: Wonsuk Lee <wonsuk11.lee@samsung.com>
Cc: public-html@w3.org, dw.im@samsung.com, ּ <sh9.choi@samsung.com>, 赿 <donggwan.kim@samsung.com>, <minhyung.ko@samsung.com>
Hi Wonsuk,

On Thu, Dec 6, 2012 at 10:32 AM, Wonsuk Lee <wonsuk11.lee@samsung.com>wrote:

> Hi. All.****
>
> ** **
>
> I have some questions about the video element.
> (http://dev.w3.org/html5/spec/single-page.html#the-video-element)****
>
>
> If we give width and height to the video element, video will be scaled
> regarding the given size.****
>
>
> Then, how about this? No given size to the video element, and small size
> of div element which is parent of the vedeo element.****
>
>  ****
>
> Below is the example.****
>
> Let's say the intrinsic size of the sample.mp4 is 300px/300px.****
>
> <div width=150px height=150px>
> <video src="sample.mp4" />
> </div>
>

I think you mean:
<div style="width:150px; height:150px;">
<video src="sample.mp4" />
</div>

since <div> doesn't have a width and height attribute.


> ****
>
>
> In this case, is the video supposed to be down-scaled? or, rendered only
> 1/4 of the video which is left-top corner.
> (Latter is how Chrome browser works.)****
>
>
> Actually, the spec says like this.
>  - In the absence of style rules to the contrary, video content should be
> rendered inside the element's playback area such that the video content is
> shown centered in the playback area at the largest possible size that fits
> completely within it, with the video content's aspect ratio being
> preserved. ****
>
>  ****
>
> But I cannot fully understand what the "playback area" means in the
> context.
> I'm thinking the "playback area" means the div region in above case. Am I
> right?
>

The "playback area" here refers to the video element's dimensions.


> Could anyone make clear this for me?
>

The video element's dimensions in Web browsers are calculated according to
CSS rules. The video element is a replaced inline element and thus CSS
inline-replaced formatting applies (display:inline).
http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width

Note that the HTML spec says:
"When a video<http://dev.w3.org/html5/spec/single-page.html#the-video-element>element's
media
resource <http://dev.w3.org/html5/spec/single-page.html#media-resource> has
a video channel, the element provides a paint
source<http://dev.w3.org/html5/spec/single-page.html#provides-a-paint-source>whose
width is the media
resource <http://dev.w3.org/html5/spec/single-page.html#media-resource>'s
intrinsic
width<http://dev.w3.org/html5/spec/single-page.html#concept-video-intrinsic-width>,
whose height is the media
resource<http://dev.w3.org/html5/spec/single-page.html#media-resource>'s
intrinsic height<http://dev.w3.org/html5/spec/single-page.html#concept-video-intrinsic-height>,
and whose appearance is the frame of video corresponding to the current
playback position<http://dev.w3.org/html5/spec/single-page.html#current-playback-position>,
if that is available, or else (e.g. when the video is seeking or buffering)
its previous appearance, if any, or else (e.g. because the video is still
loading the first frame) blackness."

Thus, the video element's width and height are determined by the video
resource's width and height and not by the width and height of a parent
element.

Thanks in advance.
>

Hope this helps.

Cheers,
Silvia.


> ****
>
> ** **
>
> Best regards,****
>
> Wonsuk. ****
>
> ========================================= ****
>
> *   (Wonsuk, Lee) / *Principal Engineer, Ph.D****
>
> *SAMSUNG ELECTRONICS Co., LTD. (**߲)*****
>
> Mobile: +82-10-5800-3997****
>
> E-mail: wonsuk11.lee@samsung.com****
>
> http://www.wonsuk73.com/, twitter: @wonsuk73****
>
> -----------------------------------------****
>
> *Inspire the World, Create the Future !!!*****
>
> =========================================****
>
> ** **
>
Received on Saturday, 15 December 2012 10:03:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 15 December 2012 10:03:12 GMT