interface IPlayerApi
package com.turner.top.sdk.core.api
The entry point for the player sdk.
Methods
addCue (cue:Dynamic):IPlayerApi
Adds a cue that can be triggered based on the given data.
Parameters:
cue | Can be one of three types: Cue, ExternalCue, or CueNotification |
|---|
attach (viewElement:NativeViewElement):IPlayerApi
Add the video player to the DOM.
Parameters:
viewElement | The DOM element to add the video player to. |
|---|
See:
canAutoPlay ():Promise<Bool>
Whether or not autoPlay is possible for the current browser or device. Takes into account whether the video element is primed (user has interacted with the page).
Returns:
Promise<Bool>
init (initConfigData:PlayerInitConfigData):IPlayerApi
Initialize the player.
Parameters:
initConfigData | Defines default values for player configuration |
|---|
isContentActive ():Bool
Checks if the player is in the process of setting up or playing content
Returns:
Bool
play (data:ContentPlayData, ?options:Dynamic):IPlayerApi
Play specified content.
Parameters:
data | Info about the content to play. |
|---|---|
options | Optional data to pass for the specific play. See Integration - Play Options |
Returns:
IPlayerApi
See:
playByContentXml (data:ContentProviderData, ?options:Dynamic):IPlayerApi
Play content via content.xml
Parameters:
data | Info about the content to play.
| ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Optional data to pass for the specific play. See Integration - Play Options |
Returns:
IPlayerApi
See:
playByMediaJson (data:ContentProviderData, ?options:Dynamic):IPlayerApi
Play content via mediaJson
Parameters:
data | Info about the content to play.
| ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Optional data to pass for the specific play. See Integration - Play Options |
Returns:
IPlayerApi
See:
ready (cb:Void ‑> Void):IPlayerApi
Executes the given callback once the player is in a ready state.
Parameters:
cb | The callback to invoke |
|---|
removeCue (cue:Dynamic):IPlayerApi
Removes a cue that can be triggered based on the given data.
Parameters:
cue | Can be one of three types: Cue, ExternalCue, or CueNotification |
|---|
reportError (event:AnalyticsErrorData):IPlayerApi
Api for reporting errors to any configured analytics libraries
Parameters:
event | Contains the error data to report to all analytics libraries |
|---|
reportEvent (event:AnalyticsEventData):IPlayerApi
Api for reporting events to any configured analytics libraries
Parameters:
event | Contains the event data to report to all analytics libraries |
|---|
resize (width:Float, height:Float):IPlayerApi
Change the dimensions of the player
Parameters:
width | In pixels |
|---|---|
height | In pixels |
seek (time:Float):IPlayerApi
Seek content to specified position
Parameters:
time | The time in seconds between 0 and the length of the content |
|---|
selectCaptionTrack (track:CCTrack):IPlayerApi
Specify which closed caption track instance to use. Note, this method will auto-enable closed captions for the player.
Parameters:
track | The closed caption track to select |
|---|
selectCaptionTrackByLang (lang:CCLang):IPlayerApi
Specify which closed caption track to use by language. Note, this method will auto-enable closed captions for the player.
Parameters:
lang | The language of the track to select |
|---|
setCaptionsEnabled (enabled:Bool):IPlayerApi
Set whether closed captions are enabled or disabled. Note, a track must be selected for this to take effect.
Parameters:
enabled | true to enable captions |
|---|
uniqueId ():Null<String>
Returns a unique ID representing the page hostname, player container ID and the timestamp in which the player instance was initialized.
Returns:
Null<String>
updateCaptionSettings (settings:CCSettings):IPlayerApi
Set the styles for closed captions.
Parameters:
settings | Defines how to style captions |
|---|
updateConfig (data:PlayerConfigData):IPlayerApi
Override the player configuration data after the player has been initialized. Overridden properties will be applied to currently playing content when possible and will be applied to subsequent content during the lifetime of the player.
Parameters:
data | Data used to override current player configuration |
|---|
Returns:
IPlayerApi
userAction (?result:Event):IPlayerApi
Registers a user action on the player. Primes the video ahead of time, which will allow it to be played without a user interaction later in browsers which block auto play.
Parameters:
result | The default JavaScript HTML Event result returned from event callbacks |
|---|
Returns:
IPlayerApi
See: