Error object, and if
possible send the error code and message received from media player using IPlayerSessionError
Properties
setHandler
setHandler:Assigns a handler to process requests for Kepler player actions associated with the given component ID. Assigning a handler is essential for processing Kepler player requests and implementing custom Kepler player logic. This call allows one handler per component. The active handler is the one set by the last invocation to setHandler.(handler:IPlayerServerHandler, componentId: string) => void
Parameters
handler
IPlayerServerHandlercomponentId
string
Examples
updateBufferedRanges
updateBufferedRanges:Notifies interested clients about Kepler player buffered ranges. Updating the server session playback buffered ranges is crucial for reflecting changes in media playback status, currently selected media, and other related information.(bufferedRanges: Array<ITimeRange>, sessionId?:IPlayerSessionId) => Promise<void>
Parameters
bufferedRanges
ITimeRange[]
sessionId?
IPlayerSessionIdReturns
Promise<void>
Promise that resolves when the update is complete.
updateStatus
updateStatus:Notifies interested clients about Kepler player session status updates. Updating the kepler player server session status is crucial for reflecting changes in media playback status, currently selected media, and other related information. For instance, apps will register media related EventListener on(status: Array<IPlayerSessionStatus>) => Promise<void>
AudioPlayer or VideoPlayer
(https://html.spec.whatwg.org/#event-handlers-on-elements,-document-objects,-and-window-objects)
and then update the parameters of IPlayerSessionStatus accordingly and call
updateStatus.
When applicable, a Kepler player server is expected to issue session status updates upon acting on a
Kepler player request received through the installed IPlayerServerHandler instance.
Parameters
status
IPlayerSessionStatus[]
Returns
Promise<void>
Promise that resolves when the update is complete.
Examples
addTrack
addTrack:Notifies interested clients about Kepler player new track. {Audio,Video}Player must register to “addtrack” EventListener in AudioTrackList | VideoTrackList | TextTrackList, and then call this API. Updating the server session new track is crucial for reflecting changes in media playback status, currently selected media, and other related information. Apps can register to “addtrack” EventListener on HtmlMediaElement.{audioTracks,videoTracks,textTracks} attributes and then call(newTrack:ITrackInfo, sessionId?:IPlayerSessionId) => Promise<void>
IPlayerServer.addTrack if the event is emitted.
Example:
Parameters
newTrack
ITrackInfosessionId?
IPlayerSessionIdReturns
Promise<void>
Promise that resolves when the update is complete.
removeTrack
removeTrack:Notifies interested clients about Kepler player existing track removed. {Audio,Video}Player must register to “removetrack” EventListener in AudioTrackList | VideoTrackList | TextTrackList, and then call this API. Updating the server session removed track is crucial for reflecting changes in media playback status, currently selected media, and other related information. Apps can register to “removetrack” EventListener on HtmlMediaElement.{audioTracks,videoTracks,textTracks} attributes and then call(removedTrack:ITrackInfo, sessionId?:IPlayerSessionId) => Promise<void>
IPlayerServer.removeTrack if the event is emitted.
Example:
Parameters
removedTrack
ITrackInfosessionId?
IPlayerSessionIdReturns
Promise<void>
Promise that resolves when the update is complete.
sendMessage
sendMessage:Provides a way to send custom message to interactive component. Any JSON type can be sent as a message (except(message: any, sessionId?:IPlayerSessionId) => Promise<void>
undefined).
This is particularly useful in providing custom messages which can be used to by client to update UI.
Parameters
message
any
sessionId?
IPlayerSessionIdReturns
Promise<void>
Promise that resolves when the message is sent or rejects with an error
if the request fails, or message is undefined.
Examples
sendError
sendError:Provides the way to send the error from service component to interactive component. Apps can register to “error” EventListener on HtmlMediaElement instance and then call(error:IPlayerSessionError, sessionId?:IPlayerSessionId) => Promise<void>
IPlayerServer.addTrack if the event is emitted.
Parameters
error
IPlayerSessionErrorsessionId?
IPlayerSessionIdReturns
Promise<void>
Promise that resolves when the error is sent.

