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

HTML Audio/Video DOM audioTracks Property

HTML Audio/Video DOM audioTracks Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Get the number of available audio tracks:

myVid=document.getElementById("video1");

alert(myVid.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

audio|video

.audioTracks

Return Value

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

AudioTrackList object:

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

    | | AudioTrack Object | Represents an audio track.

    Properties of the AudioTrack object:

    |

    HTML audio/video Tag Reference HTML Audio/Video DOM Reference