Latest web development tutorials

HTML DOM Video Object

Video Object

Video objects are new in HTML5.

Video object represents an HTML <video> element.

Access Video objects t

You can access by using the getElementById () <video> element:

var x = document.getElementById ( "myVideo" ); try

Create a Video object

You can create a <video> method by using document.createElement () elements:

var x = document.createElement ( "VIDEO" ); try

Video Object Properties

Attributes description
audioTracks Back AudioTrackList objects available audio tracks representation.
autoplay Immediately after playing the video settings or returns whether the Ready (finished loading).
buffered Returns video TimeRanges buffered portion of the object.
controller It returns the current MediaController objects video media controller.
controls Sets or returns whether the video should display controls (such as play / pause, etc.).
crossOrigin Sets or returns the video CORS settings.
currentSrc Returns the current URL of the video.
currentTime Sets or returns the current video playback position (in seconds).
defaultMuted Sets or returns whether the default video mute.
defaultPlaybackRate Sets or returns the default playback speed of the video.
duration Returns the length of the video (in seconds).
ended Whether to return the video playback has ended.
error Return to video Error state MediaError object representation.
height Sets or returns the value of the video height attributes.
loop Sets or returns whether the video should be playing again at the end.
mediaGroup Sets or returns the name of the video to your media portfolio.
muted Sets or returns whether to turn off the sound.
networkState Returns the current state of the video network.
paused Sets or returns the video is paused.
playbackRate Sets or returns the video playback speed.
played Returns have TimeRanges video playback portion of the object.
poster Sets or returns the value of the video poster attributes.
preload Sets or returns the value of the video preload property.
readyState Returns the current video ready.
seekable Back TimeRanges target video addressable portion of Fig.
seeking Returns whether the user is currently being carried out to find a video.
src Sets or returns the value of the src attribute of the video.
startDate Returns the current time offset Date object.
textTracks Back TextTrackList track objects available text representation.
videoTracks Returns available video tracks VideoTrackList object.
volume Sets or returns the video volume.
width Sets or returns the value of the video width properties.

Video Object

Method description
addTextTrack () Add a new text to the video track.
canPlayType () Check your browser is capable of playing the specified video type.
load () Reload video elements.
play () Start the video.
pause () Pause the currently playing video.

Standard properties and events

Video object also supports the standard attributes and events .


related articles

HTML Tutorial: the HTML5 video

HTML Reference Manual: HTML <Video> tag