HTML DOM Video Object

Video object

Het Video object is een nieuw object in HTML5.

Het Video object representerert het HTML <video> element.

Toegang tot het Video object

U kunt de <video> element bereiken door het gebruik van getElementById():

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

Try it yourself

Create Video object

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

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

Try it yourself

Video object properties

Eigenschappen Beschrijving
audioTracks Return the AudioTrackList object representing the available audio tracks.
autoplay Set or return whether the video should play immediately after loading is complete.
buffered Return the TimeRanges object representing the buffered parts of the video.
controller Return the MediaController object representing the current media controller of the video.
controls Set or return whether the video controls (such as play/pause) should be displayed.
crossOrigin Set or return the CORS settings of the video.
currentSrc Return the current URL of the video.
currentTime Set or return the current playback position in the video (in seconds).
defaultMuted Set or return whether the video is muted by default.
defaultPlaybackRate Set or return the default playback rate of the video.
duration Return the length of the video (in seconds).
ended Return whether the playback of the video has ended.
error Return the MediaError object representing the error state of the video.
height Set or return the value of the video's height attribute.
loop Set or return whether the video should play again at the end.
mediaGroup Set or return the name of the media group to which the video belongs.
muted Set or return whether the sound is muted.
networkState Return the current network state of the video.
paused Set or return whether the video is paused.
playbackRate Set or return the playback speed of the video.
played Return the TimeRanges object representing the played parts of the video.
poster Set or return the value of the video's poster attribute.
preload Set or return the value of the video's preload attribute.
readyState Return the current ready state of the video.
seekable Return the TimeRanges object representing the addressable parts of the video.
seeking Retourneer of de gebruiker momenteel aan het zoeken is in de video.
src Stel in of retourneer de waarde van de src eigenschap van de video.
startDate Retourneer het Date object dat de huidige tijdsoffset vertegenwoordigt.
textTracks Retourneer het TextTrackList object dat de beschikbare tekst tracks vertegenwoordigt.
videoTracks Retourneer het VideoTrackList object dat de beschikbare video tracks vertegenwoordigt.
volume Stel in of retourneer de volume van de video.
width Stel in of retourneer de waarde van de width eigenschap van de video.

Video object methoden

Methode Beschrijving
addTextTrack() Voeg een nieuwe tekstspoor toe aan de video.
canPlayType() Controleer of de browser de opgegeven video-type kan afspelen.
load() Herlaad het video-element.
play() Start de video afspelen.
pause() Pauzeer de huidige afgespeelde video.

Standaard eigenschappen en gebeurtenissen

Video object ondersteunt standaardenEigenschappenenGebeurtenissen.

Gerelateerde pagina's

HTML handleiding:HTML5 video

HTML referentiehandleiding:HTML <video> tag