Class: Track

Constructor

Track

new Track(trackId, trackType)

Parameter

trackId

number

The unique identifier for the track.

trackType

cast.framework.messages.TrackType

The type of track.

Value must not be null.

Properties

audioTrackInfo

(non-null cast.framework.messages.AudioTrackInfo or undefined)

Audio-specific information about the track. Defined only for Track#type === 'AUDIO' tracks.

customData

(non-null Object or undefined)

Custom data set by the receiver application.

isInband

(boolean or undefined)

true indicates that the track is in-band and not a side-loaded track. Relevant only for text tracks.

language

(string or undefined)

An RFC 5646 language tag. If the track subtype is SUBTITLES, this field is mandatory.

name

(string or undefined)

A descriptive, human-readable name for the track, for example, Spanish.

roles

(non-null Array of string or undefined)

The role(s) of the track. The following values for each media type are recognized, with value explanations described in ISO/IEC 23009-1, labeled "DASH role scheme":

  • VIDEO: caption, subtitle, main, alternate, supplementary, sign, emergency
  • AUDIO: main, alternate, supplementary, commentary, dub, emergency
  • TEXT: main, alternate, subtitle, supplementary, commentary, dub, description, forced_subtitle

subtype

(string or undefined)

For text tracks, the type of the text track.

trackContentId

(string or undefined)

The trackContentId can be the URL of the track or any other identifier that allows the receiver to find the content (when the track is not in-band or is not included in the manifest). For example, this can be the URL of a VTT file.

trackContentType

(string, non-null cast.framework.messages.CaptionMimeType, or undefined)

This represents the MIME type of the track content. For example, if the track is a VTT file, this will have the value ‘text/vtt’. This field is needed for out-of-band tracks, so it is usually provided if a trackContentId has also been provided. If the receiver has a way to identify the content from the trackContentId, this field is recommended but is not mandatory. The track content type, if provided, must be consistent with the track type.

trackId

number

The unique identifier of the track within the context of a MediaInformation object.

type

non-null cast.framework.messages.TrackType

The type of track ('TEXT', 'AUDIO', or 'VIDEO').