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

HTML DOM Video videoTracks Property

Video videoTracks property

Video Object Reference The Video object

Example

Get the number of available video tracks:

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

Try it »


Definition and Usage

The videoTracks property returns a VideoTrackList object.

The VideoTrackList object represents the available video tracks of the video.

The VideoTrack object represents each available video track.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Currently no major browser supports the videoTracks property.


Syntax

videoObject

.videoTracks

Return Value

Type Description
TextTrackList object

Represents the available video tracks of the video.

VideoTrackList object:

  • videoTracks.length - Get the number of available video tracks in the video
  • videoTracks.getTrackById(id) - Get the VideoTrack object by id
  • videoTracks[index] - Get the VideoTrack object by index
  • videoTracks.selectedIndex - Get the index of the current VideoTrack object
  • Note:The index of the first available VideoTrack object is 0.

    | | TextTrack object |

    Represents a single video track.

    Properties of the VideoTrack object:

    |

    Video Object Reference The Video object