Properties
handleLoad
handleLoad:Handles a request to load content by URL. This call is received when apps call(mediaInfo:IPlayerSessionMediaInfo, loadParams?:IPlayerSessionLoadParams, sessionId?:IPlayerSessionId) => void
IPlayerClient.load from interactive component.
Apps must implement this function to initialize MediaPlayer instance with the fields
values provided in mediaInfo and loadParams for player session corresponding to sessionId.
Parameters
mediaInfo
IPlayerSessionMediaInfo The object to describe the necessary URLs and HTTP headers to load media content.loadParams?
IPlayerSessionLoadParams Params required to load content by URL.sessionId?
IPlayerSessionId The session ID to target for loading content. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleUnload
handleUnload:Unloads content from a media session in response to(sessionId?:IPlayerSessionId) => void
IPlayerClient.unload calls from the interactive component.
Applications must implement this function to release MediaPlayer and Media Source Extensions (MSE) resources
for the player session associated with the given sessionId.
Parameters
sessionId?
IPlayerSessionId The session ID of the content to unload. If not provided, the PlayerServer determines how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleUnloadSync?
Unloads content from a media session in response tooptionalhandleUnloadSync:((timeoutMsec: number, sessionId?:IPlayerSessionId) =>IUnloadSyncStatus)
IPlayerClient.unloadSync calls from the interactive component.
Applications must implement this function to release MediaPlayer and Media Source Extensions (MSE) resources
for the player session associated with the given sessionId synchronously.
For W3CMedia MediaPlayer instance, use deinitializeSync API.
Parameters
timeoutMsec
number
Maximum allowed time (in milliseconds) for unloadSync API to execute.
Minimum value is 1000, maximum value is 5000.
sessionId?
IPlayerSessionId The session ID of the content to unload. If not provided, the PlayerServer determines how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
Returns
IUnloadSyncStatus The status of synchronous deinitialize of mediaplayer instance corresponding tosessionId.
handleSetVideoView
handleSetVideoView:Handles a request to set the video view. This call is received when apps call(handle:IViewHandle, sessionId?:IPlayerSessionId) => void
IPlayerClient.setVideoView from interactive component.
Parameters
handle
IViewHandle The identifier for the shared surface.sessionId?
IPlayerSessionId The session ID to target for setting the video surface. If not specified, the PlayerServer decides how to handle the request. Apps must implement this function to callsetSurfaceHandle on
VideoPlayer instance corresponding to sessionId.
Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleClearVideoView
handleClearVideoView:Handles a request to clear the text view. This call is received when apps call(sessionId?:IPlayerSessionId) => void
IPlayerClient.clearVideoView from interactive component.
Apps must implement this function to call clearSurfaceHandle on
VideoPlayer instance corresponding to sessionId.
Parameters
sessionId?
IPlayerSessionId The session ID to target for clearing the text view. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSetTextView
handleSetTextView:Handles a request to set the text view. This call is received when apps call(handle:IViewHandle, sessionId?:IPlayerSessionId) => void
IPlayerClient.setTextView from interactive component.
Apps must implement this function to call setCaptionViewHandle on
VideoPlayer instance corresponding to sessionId.
Parameters
handle
IViewHandle The identifier for the shared surface.sessionId?
IPlayerSessionId The session ID to target for setting the captions surface. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleClearTextView
handleClearTextView:Handles a request to clear the text view. This call is received when apps call(sessionId?:IPlayerSessionId) => void
IPlayerClient.clearTextView from interactive component.
Apps must implement this function to call clearCaptionViewHandle on
VideoPlayer instance corresponding to sessionId.
Parameters
sessionId?
IPlayerSessionId The session ID to target for clearing the captions surface. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handlePlay
handlePlay:Handles a request to resume or start playback. This call is received when apps call(sessionId?:IPlayerSessionId) => void
IPlayerClient.play from interactive component.
Apps must implement this function to call play on {Video,Audio}Player instance corresponding to sessionId.
If the application is already playing and the playback speed is not normal (not 1.0)
this may return playback to normal speed.
Receiving multiple play requests while already in playing state is not an error and should signal success.
The media server should update the corresponding IISessionStatus to reflect the new playback status.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handlePause
handlePause:Handles a request to pause playback. This call is received when apps call(sessionId?:IPlayerSessionId) => void
IPlayerClient.pause from interactive component.
Apps must implement this function to call pause on {Video,Audio}Player instance corresponding to sessionId.
Receiving multiple pause requests while already in pause state is not an error and should signal success.
The media server should update the corresponding IISessionStatus to reflect the new playback status.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSeek
handleSeek:Handles a request to seek to seek to a given playback position. This call is received when apps call(position: number, isRelative?: boolean, sessionId?:IPlayerSessionId) => void
IPlayerClient.seek from interactive component.
Apps must implement this function to change currentTime of {Video,Audio}Player
instance corresponding to sessionId.
The media server should update the corresponding IISessionStatus to reflect the new playback position.
Parameters
position
number
The playback position to seek to, either relative to the
current playback position (isRelative = true); or relative to the start of the media where 0
represents the start of the media (isRelative = false).
isRelative?
boolean
If the position provided is relative to the current playback
position (isRelative = true) or an absolute position in the media (isRelative = false).
Default value is false.
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSetMute
handleSetMute:Handles a request to mute playback. This call is received when apps call(isMuted: boolean, sessionId?:IPlayerSessionId) => void
IPlayerClient.setMute from interactive component.
Apps must implement this function to set muted on {Video,Audio}Player instance corresponding to sessionId.
The media server should update the corresponding IISessionStatus to reflect the new playback status.
Parameters
isMuted
boolean
If true, the media should be muted;
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSetPlaybackRate
handleSetPlaybackRate:Handles a request to set playback speed of media playback. This call is received when apps call(playbackRate: number, sessionId?:IPlayerSessionId) => void
IPlayerClient.setPlaybackRate from interactive component.
Apps must implement this function to set playbackRate on {Video,Audio}Player instance corresponding to sessionId.
The media sesssion should update its IISessionStatus to reflect the new playback status.
Parameters
playbackRate
number
The playback speed to set, like 0.25, 0.5, 2.0 etc
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSetVolume
handleSetVolume:Handles a request to set volume of media playback. This call is received when apps call(volume: number, sessionId?:IPlayerSessionId) => void
IPlayerClient.setVolume from interactive component.
Apps must implement this function to set volume on {Video,Audio}Player instance corresponding to sessionId.
The media sesssion should update its IISessionStatus to reflect the new playback status.
Parameters
volume
number
The volume to set, in the range of 0.0 to 1.0.
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleSetActiveTrack
handleSetActiveTrack:Handles a request to set the active track of media playback. This call is received when apps call(trackType:ITrackType, trackId: string, sessionId?:IPlayerSessionId) => void
IPlayerClient.setActiveTrack from interactive component.
Apps must implement this function to set audio, video or text track by ID on MSE player instance.
The media sesssion should update its IISessionStatus to reflect the new playback status.
Parameters
trackType
ITrackType The type of the track to set as active.trackId
string
The track ID of the track to set as active.
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleGetCurrentPosition
handleGetCurrentPosition:Handles request for interactive component to get the current playback position of media playback. This call is received when apps call(sessionId?:IPlayerSessionId) => number
IPlayerClient.getCurrentPosition from interactive component.
Apps must implement this function to get currentTime from {Audio,Video} Player instance corresponding to sessionId
and then apps must resolve promise with number indicating current playback position (in seconds).
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
Returns
number
The current playback position of media playback session
corresponding to sessionId.
handleMessage
handleMessage:Handles a request to receive a custom message from interactive component. Apps can use(message: any, sessionId?:IPlayerSessionId) => void
message object to perform custom operations.
This call is received when apps call IPlayerClient.sendMessage from interactive component.
Apps may implement this function to handle custom operations in service component.
Parameters
message
any
The message to be handled. To be sent as JSON object.
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the PlayerServer decides how to handle the request.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStartBufferedRangesUpdates
handleStartBufferedRangesUpdates:This call is received when apps make at least one(sessionId?:IPlayerSessionId) => void
IPlayerClient.registerBufferedRangesListener
call for sessionId from interactive component.
Apps must start sending buffered ranges updates corresponding to sessionId
by calling IPlayerServer.updateBufferedRanges API from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStopBufferedRangesUpdates
handleStopBufferedRangesUpdates:This call is received when apps unsubscribe all(sessionId?:IPlayerSessionId) => void
IPlayerSessionBufferedRangesListener
instances for sessionId from interactive component.
Apps must stop sending buffered ranges updates corresponding to sessionId
from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStartStatusUpdates
handleStartStatusUpdates:This call is received when apps make at least one(sessionId?:IPlayerSessionId) => void
IPlayerClient.registerStatusListener
call for sessionId from interactive component.
Apps must start sending player session status updates corresponding to sessionId
by calling IPlayerServer.updateStatus API from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStopStatusUpdates
handleStopStatusUpdates:This call is received when apps unsubscribe all(sessionId?:IPlayerSessionId) => void
IPlayerSessionStatusListener
instances for sessionId from interactive component.
Apps must stop sending player session status updates corresponding to sessionId
from service compoenent.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStartTrackUpdates
handleStartTrackUpdates:This call is received when apps make at least one(sessionId?:IPlayerSessionId) => void
IPlayerClient.registerTrackListener
call for sessionId from interactive component.
Apps must start sending player session track updates corresponding to sessionId by calling
IPlayerServer.addTrack or IPlayerServer.removeTrack APIs from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStopTrackUpdates
handleStopTrackUpdates:This call is received when apps unsubscribe all(sessionId?:IPlayerSessionId) => void
IPlayerSessionTrackListener
instances for sessionId from interactive component.
Apps must stop sending player session track updates corresponding to sessionId
from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStartMessageUpdates
handleStartMessageUpdates:This call is received when apps make at least one(sessionId?:IPlayerSessionId) => void
IPlayerClient.registerMessageListener
call for sessionId from interactive component.
Apps can start sending custom messages as JSON objects by calling
IPlayerServer.sendMessage API corresponding to sessionId from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStopMessageUpdates
handleStopMessageUpdates:This call is received when apps unsubscribe all(sessionId?:IPlayerSessionId) => void
IPlayerSessionTrackListener
instances for sessionId from interactive component. So, service component should not
send any message corresponding to sessionId as there is no receiver of
these messages available.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStartErrorUpdates
handleStartErrorUpdates:This call is received when apps make at least one(sessionId?:IPlayerSessionId) => void
IPlayerClient.registerErrorListener
call for sessionId from interactive component.
Apps can start sending IPlayerSessionError as JSON objects by calling
IPlayerServer.sendError API corresponding to sessionId from service component.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.
handleStopErrorUpdates
handleStopErrorUpdates:This call is received when apps unsubscribe all(sessionId?:IPlayerSessionId) => void
IPlayerSessionErrorListener
instances for sessionId from interactive component. So, service component should not
send any errors corresponding to sessionId as there is no receiver of
these messages available.
Parameters
sessionId?
IPlayerSessionId The session ID to target with the request. If not specified, the session to target is decided by the server.Throws
InvalidArgumentErrorif the given sessionId does not exist.

