your image

HTML Audio/Video DOM Reference

w3schools
Related Topic
:- HTML CSS

HTML Audio/Video DOM Reference

PreviousNext

HTML Audio and Video DOM Reference

The HTML5 DOM has methods, properties, and events for the <audio> and <video> elements.

HTML Audio/Video Methods

MethodDescriptionaddTextTrack()Adds a new text track to the audio/videocanPlayType()Checks if the browser can play the specified audio/video typeload()Re-loads the audio/video elementplay()Starts playing the audio/videopause()Pauses the currently playing audio/video

HTML Audio/Video Properties

PropertyDescriptionaudioTracksReturns an AudioTrackList object representing available audio tracksautoplaySets or returns whether the audio/video should start playing as soon as it is loadedbufferedReturns a TimeRanges object representing the buffered parts of the audio/videocontrollerReturns the MediaController object representing the current media controller of the audio/videocontrolsSets or returns whether the audio/video should display controls (like play/pause etc.)crossOriginSets or returns the CORS settings of the audio/videocurrentSrcReturns the URL of the current audio/videocurrentTimeSets or returns the current playback position in the audio/video (in seconds)defaultMutedSets or returns whether the audio/video should be muted by defaultdefaultPlaybackRateSets or returns the default speed of the audio/video playbackdurationReturns the length of the current audio/video (in seconds)endedReturns whether the playback of the audio/video has ended or noterrorReturns a MediaError object representing the error state of the audio/videoloopSets or returns whether the audio/video should start over again when finishedmediaGroupSets or returns the group the audio/video belongs to (used to link multiple audio/video elements)mutedSets or returns whether the audio/video is muted or notnetworkStateReturns the current network state of the audio/videopausedReturns whether the audio/video is paused or notplaybackRateSets or returns the speed of the audio/video playbackplayedReturns a TimeRanges object representing the played parts of the audio/videopreloadSets or returns whether the audio/video should be loaded when the page loadsreadyStateReturns the current ready state of the audio/videoseekableReturns a TimeRanges object representing the seekable parts of the audio/videoseekingReturns whether the user is currently seeking in the audio/videosrcSets or returns the current source of the audio/video elementstartDateReturns a Date object representing the current time offsettextTracksReturns a TextTrackList object representing the available text tracksvideoTracksReturns a VideoTrackList object representing the available video tracksvolumeSets or returns the volume of the audio/video

ADVERTISEMENT

 

HTML Audio/Video Events

EventDescriptionabortFires when the loading of an audio/video is abortedcanplayFires when the browser can start playing the audio/videocanplaythroughFires when the browser can play through the audio/video without stopping for bufferingdurationchangeFires when the duration of the audio/video is changedemptiedFires when the current playlist is emptyendedFires when the current playlist is endederrorFires when an error occurred during the loading of an audio/videoloadeddataFires when the browser has loaded the current frame of the audio/videoloadedmetadataFires when the browser has loaded meta data for the audio/videoloadstartFires when the browser starts looking for the audio/videopauseFires when the audio/video has been pausedplayFires when the audio/video has been started or is no longer pausedplayingFires when the audio/video is playing after having been paused or stopped for bufferingprogressFires when the browser is downloading the audio/videoratechangeFires when the playing speed of the audio/video is changedseekedFires when the user is finished moving/skipping to a new position in the audio/videoseekingFires when the user starts moving/skipping to a new position in the audio/videostalledFires when the browser is trying to get media data, but data is not availablesuspendFires when the browser is intentionally not getting media datatimeupdateFires when the current playback position has changedvolumechangeFires when the volume has been changedwaitingFires when the video stops because it needs to buffer the next frame

Comments