Skip to content

Latest commit

 

History

History
408 lines (267 loc) · 7.55 KB

api.md

File metadata and controls

408 lines (267 loc) · 7.55 KB

Table of Contents

CastConfigObject

Type: Object

Parameters

  • receiverApplicationId string Cast application id.
  • autoJoinPolicy string Indicates if to join a running session on initialization. (optional, default chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED)
  • liveEdgeThreshold number Threshold from which you are not at the live edge. (optional, default 5)
  • advertising Object The advertising options. (optional, default {vast:false})
    • advertising.vast boolean Whether using VAST ad tags (false means using VMAP ad tags). (optional, default false)

CastAdsController

Cast Ads Controller.

skipAd

Skips on an ad.

Returns void

CastPlayer

Extends BaseRemotePlayer

Cast Sender Player.

Parameters

  • config CastConfigObject The cast configuration.
  • remoteControl RemoteControl The remote control.

loadMedia

Loads a media to the receiver application.

Parameters

Returns Promise<void> Promise to indicate load succeed or failed.

getMediaInfo

Gets the media Info.

Returns ProviderMediaInfoObject The media info.

ready

The cast player readiness.

Returns Promise<any> Promise which resolved when the cast player is ready.

play

Start/resume playback.

Returns void

pause

Pause playback.

Returns void

reset

Stops and reset the cast player.

Returns void

destroy

Destroys the cast player.

Returns void

isLive

Returns boolean Whether the current playback is a live playback.

isDvr

Returns boolean Whether the current live playback has DVR window. In case of non-live playback will return false.

seekToLiveEdge

Seeks to the live edge.

Returns void

getStartTimeOfDvrWindow

Returns number The start time of the DVR window.

enableAdaptiveBitrate

Enables automatic adaptive bitrate switching.

Returns void

isAdaptiveBitrateEnabled

Returns boolean Whether adaptive bitrate is enabled.

getTracks

Parameters

Returns Array<Track> The cast player tracks.

getActiveTracks

Returns Object The cast player active tracks.

selectTrack

Select a certain track to be active.

Parameters

  • track Track The track to activate.

Returns void

hideTextTrack

Hides the active text track.

Returns void

startCasting

Start casting.

Returns Promise<any> A promise to indicate session is starting, or failed

isCastAvailable

Returns boolean Whether casting is available.

stopCasting

Stops the current cast session.

Returns void

getCastSession

Gets the current remote session.

Returns RemoteSession The remote session.

ads

Returns CastAdsController The cast ads controller.

textStyle

Setter.

Parameters

  • style TextStyle The text style to set.

Returns void

textStyle

Getter.

Returns TextStyle The current text style.

currentTime

Setter.

Parameters

  • to number The number to set in seconds.

Returns void

currentTime

Getter.

Returns number The current time in seconds.

duration

Returns number The duration in seconds.

volume

Setter.

Parameters

  • vol number The volume to set in the range of 0-1.

Returns void

volume

Getter.

Returns number The current volume in the range of 0-1.

paused

Returns boolean Whether the cast player is in paused state.

ended

Returns boolean Whether the cast player is in ended state.

seeking

Returns boolean Whether the cast player is in seeking state.

muted

Setter.

Parameters

  • mute boolean The mute value to set.

Returns void

muted

Getter.

Returns boolean The muted state.

src

Returns string The current playing source url.

poster

Returns string The current poster url.

playbackRate

Returns string The current playback rate.

engineType

Returns string The active engine type.

type

Returns string The remote player type.

config

Returns Object The runtime cast player config.

Type

The remote player type.

Type: string

isSupported

Returns boolean Whether the cast player is supported in the current runtime environment.

defaultConfig

The default cast configuration.

Type: Object