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

HTML Audio/Video DOM videoTracks Property

HTML Audio/Video DOM videoTracks Property

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

Example

Get the number of available video tracks:

myVid=document.getElementById("video1");

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

Each available video track is represented by a VideoTrack object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

No major browser supports the videoTracks property.


Syntax

video

.videoTracks

Return Value

Type Description
VideoTrackList 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] - Gets a VideoTrack object by its index
  • videoTracks.selectedIndex - Get the index of the current VideoTrack object
  • Note:The index of the first available VideoTrack object index is 0.

    | | VideoTrack object | Represents a video track.

    Properties of the VideoTrack object:

    |

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