Methods

enableStream

enableStream(streamIndex, enable)

Sets the enabled state of the stream.

Parameter

streamIndex

number

Stream index.

enable

boolean

Whether to enable or disable the stream.

getDefaultAudioStreamIndex

getDefaultAudioStreamIndex() returns number

Returns the default audio stream index, or -1 if no audio stream available.

Returns

number Default audio stream index.

getDuration

getDuration() returns number

Returns the duration of the media. If the media has no duration, e.g. live event, a negative value is returned. This should only be called after host.onManifestReady was invoked by the player.

Returns

number Duration of the media.

getQualityLevel

getQualityLevel(streamIndex) returns number

Gets the quality level used to play the stream.

Parameter

streamIndex

number

Stream index.

Returns

number Adaptive bitrate quality level.

getStreamCount

getStreamCount() returns number

Gets the stream count for the media.

Returns

number Stream count.

getStreamInfo

getStreamInfo(streamIndex) returns cast.player.api.StreamInfo

Gets stream information that includes codecs, mime type, and bitrates.

Parameter

streamIndex

number

Stream index.

Returns

non-null cast.player.api.StreamInfo Stream information.

isEventStream

isEventStream() returns boolean

Returns whether the stream is an event stream.

Returns

boolean Whether a stream is event stream.

isLiveDone

isLiveDone() returns (boolean or undefined)

Whether live stream update has ended. It will be undefined for VOD stream.

Returns

(boolean or undefined) 

isLiveSeekableRangeMovingWindow

isLiveSeekableRangeMovingWindow() returns (boolean or undefined)

Whether live stream seekable range is a sliding window. It will be undefined for VOD stream.

Returns

(boolean or undefined) 

isLiveStream

isLiveStream() returns boolean

Returns whether the stream is a live stream.

Returns

boolean Whether a stream is live stream.

isStreamEnabled

isStreamEnabled(streamIndex) returns boolean

Gets the enabled state of the stream.

Parameter

streamIndex

number

Stream index.

Returns

boolean Whether the stream is enabled or disabled.