Error object, and if
possible send the error code and message received from media player using IPlayerSessionError
Properties
addTrack()
addTrack: (newTrack, sessionId?) => Promise<void>
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.
Parameters
newTrack
ITrackInfo
Read-only details of new track added.
sessionId?
IPlayerSessionId
Optional. The session ID of the session whose new track has been added.
If not provided, treat as a request for data on all sessions.
Returns
Promise<void>
Promise that resolves when the update is complete.
Details
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 callIPlayerServer.addTrack if the event is emitted.
Example:
removeTrack()
removeTrack: (removedTrack, sessionId?) => Promise<void>
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.
Parameters
removedTrack
ITrackInfo
Readonly details of existing track removed.
sessionId?
IPlayerSessionId
Optional. The session ID of the session whose existing track has been removed.
If not provided, treat as a request for data on all sessions.
Returns
Promise<void>
Promise that resolves when the update is complete.
Details
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 callIPlayerServer.removeTrack if the event is emitted.
Example:
sendError()
sendError: (error, sessionId?) => Promise<void>
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 IPlayerServer.addTrack if the event is emitted.
Parameters
error
IPlayerSessionError
Error object to be sent.
sessionId?
IPlayerSessionId
Optional. The session ID of the session for which custom message needs to be handled.
Returns
Promise<void>
Promise that resolves when the error is sent.
Example
sendMessage()
sendMessage: (message, sessionId?) => Promise<void>
Provides a way to send custom message to interactive component.
Any JSON type can be sent as a message (except undefined).
Parameters
message
any
Custom message to be sent. send JSON value (except undefined) as message.
sessionId?
IPlayerSessionId
Optional. The session ID of the session for which custom message needs to be handled.
Returns
Promise<void>
Promise that resolves when the message is sent or rejects with an error
if the request fails, or message is undefined.
Details
This is particularly useful in providing custom messages which can be used to by client to update UI.Example
setHandler()
setHandler: (handler, componentId) => void
Assigns a handler to process requests for Kepler player actions associated with the given component ID.
Parameters
handler
IPlayerServerHandler
An instance of the IPlayerServerHandler interface to invoke
when Kepler player requests arrive.
componentId
string
An id of the service component interface representing the component for which the handler is being set.
This MUST match the service ID declared in the application manifest.
Returns
void
Details
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.Example
updateBufferedRanges()
updateBufferedRanges: (bufferedRanges, sessionId?) => Promise<void>
Notifies interested clients about Kepler player buffered ranges.
Parameters
bufferedRanges
ITimeRange[]
Updated buffered ranges for player session.
sessionId?
IPlayerSessionId
session id for which the buffered ranges are being updated.
Returns
Promise<void>
Promise that resolves when the update is complete.
Details
Updating the server session playback buffered ranges is crucial for reflecting changes in media playback status, currently selected media, and other related information.updateStatus()
updateStatus: (status) => Promise<void>
Notifies interested clients about Kepler player session status updates.
Parameters
status
IPlayerSessionStatus[]
Array of IPlayerSessionStatus containing updated session status.
Returns
Promise<void>
Promise that resolves when the update is complete.
Details
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 onAudioPlayer 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.

