Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio audioTracks Property

Audio audioTracks Property

Audio Object Reference Audio object

Example

Get the number of available audio tracks:

var x = document.getElementById("myAudio").audioTracks.length;

Try it »


Definition and Usage

The audioTracks property returns an AudioTrackList object.

Returns an AudioTrackList object representing the available audio tracks.

Each audio track represents an AudioTrack object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

No major browser supports the audioTracks property.


Syntax

audioObject

.audioTracks

Return Value

Type Description
AudioTrackList Object Represents the available audio tracks of the audio.

AudioTrackList Object:

  • audioTracks.length - gets the number of available audio tracks.
  • audioTracks.getTrackById(id) - gets the AudioTrack object by id
  • audioTracks[index] - gets the AudioTrack object by index
  • Note: (index) 0 represents the first available AudioTrack object.

    | | AudioTrack Object | Represents an audio track.

    AudioTrack Object Properties:

    |

    Audio Object Reference Audio object