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

HTML DOM Audio textTracks attribute

Audio textTracks attribute

Audio Object Reference Audio object

Example

Get the number of available text tracks:

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

Try it »


Definition and Usage

The textTracks attribute returns a TextTrackList object.

The TextTrackList object represents the available text tracks of the audio.

Each available text track is represented by a TextTrack object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer, Opera, Chrome, and Safari 6 support the textTracks attribute.

Note: Firefox and Internet Explorer 9 and earlier IE versions do not support the textTracks attribute.


Syntax

audioObject

.textTracks

Return Value

Type Description
TextTrackList object

Represents the available text tracks of the audio.

TextioTrackList object properties:

  • length - get the number of available text tracks in the audio
  • [index] - get the TextTrack object by index
  • Note:The index of the first available text track is 0.

    | | TextTrack object |

    Represents a text track.

    TextTrack object properties:

    |

    Audio Object Reference Audio object