Name

video — HTML5

Synopsis

<video> . . . </video>

Embeds a video file in the web page without requiring a plug-in. Authors can provide content in the video element that will be displayed by agents that don’t support the video element.

Notes

HTML5 only. As of this writing, there is still debate regarding the supported codec for the video element (mainly open source Ogg Theora versus the proprietary, yet more popular and more efficient, H.264). video is currently supported by Firefox 3.5+, Safari 3.2+, and Opera 10.0+. Chrome support is upcoming. Internet Explorer has not published plans to support video.

Start/End Tags

Required/Required

Attributes

HTML5 Global Attributes

autobuffer (autobuffer="autobuffer" in XHTML5)

Tells the user agent (browser) that the media file is likely to be used and should be readily available

autoplay (autoplay="autoplay" in XHTML5)

Plays the media file automatically

controls (controls="controls" in XHTML5)

Indicates that the user agent (browser) should display a set of playback controls for the media file

height="number"

Specifies the height of the video player in pixels

loop (loop="loop" in XHTML5)

Indicates that the media file should start playing again from the beginning once it reaches the end

poster="URL"

Specifies the location of a graphic file that displays as a placeholder before the video begins to play

src="URL"

Specifies the location of the media file

width="number"

Specifies the width of the video player in pixels

Examples

See also source listing.

<video src="movies/nantucket.ogv" ...

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.