HTML5 Audio/Video DOM Reference: Methods, Properties, and Events
This comprehensive reference guide details all the methods, properties, and events available in the HTML5 DOM for manipulating audio and video elements. Use this resource to master advanced control over audio and video playback in your web applications.
HTML Audio/Video DOM Reference
The HTML5 Document Object Model (DOM) provides a rich set of methods, properties, and events for manipulating and controlling audio and video elements within your web pages. This reference details these features for both `
Methods
Method | Description |
---|---|
addTextTrack() |
Adds a new text track (subtitles, captions). |
canPlayType() |
Checks if the browser supports a specific audio/video type. |
load() |
Reloads the audio/video. |
play() |
Starts playback. |
pause() |
Pauses playback. |
Properties
Property | Description |
---|---|
audioTracks |
Returns an AudioTrackList object. |
autoplay |
Sets/gets whether autoplay is enabled. |
buffered |
Returns a TimeRanges object showing buffered parts. |
controller |
Returns the MediaController object. |
controls |
Sets/gets whether to show controls. |
crossOrigin |
Sets/gets CORS settings. |
currentSrc |
Returns the current source URL. |
currentTime |
Gets/sets the current playback position (seconds). |
defaultMuted |
Sets/gets whether to mute by default. |
defaultPlaybackRate |
Sets/gets the default playback speed. |
duration |
Returns the total duration (seconds). |
ended |
Indicates if playback has ended. |
error |
Returns a MediaError object (if any). |
loop |
Sets/gets whether to loop playback. |
mediaGroup |
Sets/gets the media group (for linking elements). |
muted |
Sets/gets the mute status. |
networkState |
Returns the network state. |
paused |
Indicates if playback is paused. |
playbackRate |
Sets/gets the playback speed. |
played |
Returns a TimeRanges object of played parts. |
preload |
Sets/gets whether to preload the media. |
readyState |
Returns the ready state. |
seekable |
Returns a TimeRanges object of seekable parts. |
seeking |
Indicates if the user is seeking. |
src |
Gets/sets the media source URL. |
startDate |
Returns a Date object representing the time offset. |
textTracks |
Returns a TextTrackList object. |
videoTracks |
(Deprecated) |
volume |
Sets/gets the volume. |
Events
Event | Description |
---|---|
abort |
Loading aborted. |
canplay |
Can start playing. |
canplaythrough |
Can play through without interruption. |
durationchange |
Duration changed. |
emptied |
Playlist is empty. |
ended |
Playback ended. |
error |
An error occurred. |
loadeddata |
Current frame loaded. |
loadedmetadata |
Metadata loaded. |
loadstart |
Loading started. |
pause |
Playback paused. |
play |
Playback started. |
playing |
Playback resumed after buffering. |
progress |
Downloading progress. |
ratechange |
Playback speed changed. |
seeked |
Seeking complete. |
seeking |
User is seeking. |
stalled |
Media data unavailable. |
suspend |
Browser paused media download. |
timeupdate |
Current playback time changed. |
volumechange |
Volume changed. |
waiting |
Waiting for buffering. |