[whatwg] VIDEO tag height/width best fit

Ian Hickson ian at hixie.ch
Mon Aug 4 03:58:45 PDT 2008

On Mon, 4 Aug 2008, Biju Gm at il wrote:
> I apologize if I did not understood
> http://www.whatwg.org/specs/web-apps/current-work/#video
> I see a situation where we want to specify the height and width of the 
> BOX in which a video need to be displayed. And while writing HTML code 
> we dont know the height/width of the video. But when playing we want the 
> video to be displayed with maximum size which can fit in the BOX without 
> loosing the aspect ratio.

It's automatically like this.

# 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 adjusted aspect ratio being preserved.
 -- http://www.whatwg.org/specs/web-apps/current-work/#video

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