Audio audioTracks Property
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





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: |
Note: (index) 0 represents the first available AudioTrack object.
| | AudioTrack Object | Represents an audio track.AudioTrack Object Properties:
- id - gets the id of the audio track.
- kind - gets the type of the audio track (can be: "alternative", "description", "main", "translation", "commentary", or "" (empty string))
- label - gets the label of the audio track.
- language - gets the language of the audio track.
- enabled - gets or sets whether the track is active (true\|false)
Audio object