This page is In Progress

Notice: The WebPlatform project has been discontinued when the Stewards partnership agreement ended in September 2015. This site has been frozen, and the assets we have created will remain.

HTMLVideoElement

Summary

The HTML <video> element is used to embed video content in an HTML or XHTML document.

Inherits from HTMLMediaElementHTMLMediaElement

Properties

initialTime
Earliest point in seconds where the playback can (should) start playing
poster
Valid URL to an image ressource that will be displayed until the first frame of the video is available or will be displayed if no valid video ressource is available at all.

videoHeight
:

videoWidth
:

Methods

No methods.

Events

No events.

Inherited from HTMLMediaElement

Properties

audioTracks
:

autobuffer
:

autoplay
:

buffered
:

controls
Controls attribute used within a Audio element or Video element displays the default media controls defined by the web browser being used to open HTML document or view of a Web Application.

currentSrc
:

currentTime
:

defaultPlaybackRate
:

duration
:

ended
:

error
:

loop
:

muted
:

networkState
:

paused
:

playbackRate
:

played
:

preload
:

seekable
:

seeking
:

src
:

textTracks
:

volume
:

Methods

canPlayType
:

load
:

pause
:

play
Loads and starts playback of a media resource.

Events

canplay
Fires whenever enough data is available to determine whether a media is playable.
canplaythrough
Fires when enough data is available to determine whether a media is playable at a normal rate without interruptions.
progress
Fires to indicate progress while downloading media data.

Examples

A simple example of showing a video

<p>This is big buck bunny video.</p>
<video width="350" height="240" controls>
<source src="http://mirrorblender.top-ix.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.ogg" type="video/ogg">
</video>

View live example

Usage

 Currently, there are 3 supported video formats for the <video> element: MP4, WebM, and Ogg