Class: TextTracksManager

Methods

addTracks

addTracks(tracks)

Adds text tracks to the list.

Parameter

tracks

Array of non-null cast.framework.messages.Track

Value must not be null.

Throws

non-null Error If tracks are not available, or trackId is not unique, or add non-text tracks.

createTrack

createTrack() returns cast.framework.messages.Track

Creates a text track.

Returns

non-null cast.framework.messages.Track 

getActiveIds

getActiveIds() returns Array of number

Gets all active text ids.

Throws

non-null Error If tracksManager is not available.

Returns

non-null Array of number 

getActiveTracks

getActiveTracks() returns Array of non-null cast.framework.messages.Track

Gets all active text tracks.

Throws

non-null Error If tracksManager is not available.

Returns

non-null Array of non-null cast.framework.messages.Track 

getTextTracksStyle

getTextTracksStyle() returns (cast.framework.messages.TextTrackStyle or undefined)

Returns the current text track style.

Returns

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

getTrackById

getTrackById(id) returns cast.framework.messages.Track

Gets text track by id.

Parameter

id

number

Throws

non-null Error If id is not available or invalid.

Returns

nullable cast.framework.messages.Track 

getTracks

getTracks() returns Array of non-null cast.framework.messages.Track

Returns all (non-forced) text tracks.

Returns

non-null Array of non-null cast.framework.messages.Track 

getTracksByLanguage

getTracksByLanguage(language) returns Array of non-null cast.framework.messages.Track

Gets text tracks by language.

Parameter

language

string

Language tag as per RFC 5646.

Throws

non-null Error If language is not available.

Returns

non-null Array of non-null cast.framework.messages.Track 

setActiveByIds

setActiveByIds(newIds)

Sets text tracks to be active by id.

Parameter

newIds

Array of number

The text track ids to be enabled. To clear text tracks set the value to an empty array or null.

Value may be null.

Throws

non-null Error If id is invalid.

setActiveByLanguage

setActiveByLanguage(language)

Sets text tracks to be active by language. Only the first matching language track will be enabled.

Parameter

language

string

Language tag as per RFC 5646.

Throws

non-null Error If language is not available or invalid.

setTextTrackStyle

setTextTrackStyle(style)

Sets text track style.

Parameter

style

cast.framework.messages.TextTrackStyle

Value must not be null.