The best HTML DOM Audio Object Tutorial In 2024, In this tutorial you can learn Audio Object,Audio Object Properties,Audio Object,Standard properties and events,related articles,
Audio object represents the HTML <audio> element.
You can use getElementById () to access the <audio> element:
You can use document.createElement () method to create the <audio> element:
Attributes | description |
---|---|
audioTracks | Back AudioTrackList objects available audio tracks representation |
autoplay | Sets or returns whether to play audio immediately after loading is completed |
buffered | It returns the audio portion of the object buffer has TimeRanges |
controller | Returns current audio MediaController objects representing the media control |
controls | Sets or returns whether the audio display controls (such as play / pause, etc.) |
crossOrigin | Sets or returns the audio settings CORS |
currentSrc | Audio back to the current URL |
currentTime | Sets or returns the current audio playback position (in seconds) |
defaultMuted | Sets or returns whether the default audio mute |
defaultPlaybackRate | Sets or returns the default audio playback speed |
duration | Returns the current audio length (in seconds) |
ended | Whether to return the audio playback has ended |
error | It returns an error status of the audio objects MediaError |
loop | Sets or returns whether the audio should be replayed at the end of |
mediaGroup | Sets or returns the combined audio belongs (for connecting multiple audio elements) |
muted | Sets or returns whether the audio is muted |
networkState | Returns the current network status audio |
paused | Sets or returns whether the audio pause |
playbackRate | Sets or returns the audio playback speed |
played | Returns the audio portion of the object has been played TimeRanges |
preload | Sets or returns whether the audio should be loaded when the page loads |
readyState | Returns current audio readiness |
seekable | Back TimeRanges object audio portion of the addressable representation |
seeking | Whether the user is returned to find audio |
src | Sets or returns the current source audio elements |
textTracks | Back TextTrackList track objects available text representation |
volume | Sets or returns the volume of audio |
method | description |
---|---|
addTextTrack () | Adding a new text in the audio track |
canPlayType () | Check if your browser can play the specified audio type |
fastSeek () | Specifies the playing time in the audio player. |
getStartDate () | It returns a new Date object that represents the current timeline offset |
load () | Reload the audio elements |
play () | Start playing the audio |
pause () | Pause the currently playing audio |
Canvas object also supports the standard attributes and events .
HTML Tutorial: the HTML5 Audio
HTML Reference Manual: HTML <Audio> tag
HTML Audio / Video DOM Reference Manual: HTML Audio / Video