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

HTML DOM Video audioTracks Property

Video audioTracks property

Video Object Reference The Video object

Example

Get the number of available audio tracks:

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

Try it »


Definition and Usage

The audioTracks property returns an AudioTrackList object.

The AudioTrackList object represents the available audio tracks of the audio/video.

Each available audio track is represented by an AudioTrack object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

No major browser supports the audioTracks property.


Syntax

videoObject

.audioTracks

Return Value

Type Description
AudioTrackList Object

Represents the available audio tracks of the audio/video.

AudioTrackList object:

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

    | | AudioTrack object |

    Represents an audio track.

    Properties of the AudioTrack object:

    |

    Video Object Reference The Video object