Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support

IPlayerServerHandler

An interface for a handler that provides the service logic of the PlayerServer.

Properties

handleLoad

handleLoad: (mediaInfo: IPlayerSessionMediaInfo, loadParams?: IPlayerSessionLoadParams, sessionId?: IPlayerSessionId) => void

Handles a request to load content by URL. This call is received when apps call 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.


handleUnload

handleUnload: (sessionId?: IPlayerSessionId) => void

Unloads content from a media session in response to 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.


handleUnloadSync?

optional handleUnloadSync: ((timeoutMsec: number, sessionId?: IPlayerSessionId) => IUnloadSyncStatus)

Unloads content from a media session in response to 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.


handleSetVideoView

handleSetVideoView: (handle: IViewHandle, sessionId?: IPlayerSessionId) => void

Handles a request to set the video view. This call is received when apps call IPlayerClient.setVideoView from interactive component.


handleClearVideoView

handleClearVideoView: (sessionId?: IPlayerSessionId) => void

Handles a request to clear the text view. This call is received when apps call IPlayerClient.clearVideoView from interactive component.

Apps must implement this function to call clearSurfaceHandle on VideoPlayer instance corresponding to sessionId.


handleSetTextView

handleSetTextView: (handle: IViewHandle, sessionId?: IPlayerSessionId) => void

Handles a request to set the text view. This call is received when apps call IPlayerClient.setTextView from interactive component.

Apps must implement this function to call setCaptionViewHandle on VideoPlayer instance corresponding to sessionId.


handleClearTextView

handleClearTextView: (sessionId?: IPlayerSessionId) => void

Handles a request to clear the text view. This call is received when apps call IPlayerClient.clearTextView from interactive component.

Apps must implement this function to call clearCaptionViewHandle on VideoPlayer instance corresponding to sessionId.


handlePlay

handlePlay: (sessionId?: IPlayerSessionId) => void

Handles a request to resume or start playback. This call is received when apps call IPlayerClient.play from interactive component.

Apps must implement this function to call play on Video,AudioPlayer 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.


handlePause

handlePause: (sessionId?: IPlayerSessionId) => void

Handles a request to pause playback. This call is received when apps call IPlayerClient.pause from interactive component.

Apps must implement this function to call pause on Video,AudioPlayer 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.


handleSeek

handleSeek: (position: number, isRelative?: boolean, sessionId?: IPlayerSessionId) => void

Handles a request to seek to seek to a given playback position. This call is received when apps call IPlayerClient.seek from interactive component.

Apps must implement this function to change currentTime of Video,AudioPlayer instance corresponding to sessionId.

The media server should update the corresponding IISessionStatus to reflect the new playback position.


handleSetMute

handleSetMute: (isMuted: boolean, sessionId?: IPlayerSessionId) => void

Handles a request to mute playback. This call is received when apps call IPlayerClient.setMute from interactive component.

Apps must implement this function to set muted on Video,AudioPlayer instance corresponding to sessionId.

The media server should update the corresponding IISessionStatus to reflect the new playback status.


handleSetPlaybackRate

handleSetPlaybackRate: (playbackRate: number, sessionId?: IPlayerSessionId) => void

Handles a request to set playback speed of media playback. This call is received when apps call IPlayerClient.setPlaybackRate from interactive component.

Apps must implement this function to set playbackRate on Video,AudioPlayer instance corresponding to sessionId.

The media sesssion should update its IISessionStatus to reflect the new playback status.


handleSetVolume

handleSetVolume: (volume: number, sessionId?: IPlayerSessionId) => void

Handles a request to set volume of media playback. This call is received when apps call IPlayerClient.setVolume from interactive component.

Apps must implement this function to set volume on Video,AudioPlayer instance corresponding to sessionId.

The media sesssion should update its IISessionStatus to reflect the new playback status.


handleSetActiveTrack

handleSetActiveTrack: (trackType: ITrackType, trackId: string, sessionId?: IPlayerSessionId) => void

Handles a request to set the active track of media playback. This call is received when apps call 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.


handleGetCurrentPosition

handleGetCurrentPosition: (sessionId?: IPlayerSessionId) => number

Handles request for interactive component to get the current playback position of media playback. This call is received when apps call 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).


handleMessage

handleMessage: (message: any, sessionId?: IPlayerSessionId) => void

Handles a request to receive a custom message from interactive component. Apps can use 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.


handleStartBufferedRangesUpdates

handleStartBufferedRangesUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps make at least one 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.


handleStopBufferedRangesUpdates

handleStopBufferedRangesUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps unsubscribe all IPlayerSessionBufferedRangesListener instances for sessionId from interactive component.

Apps must stop sending buffered ranges updates corresponding to sessionId from service component.


handleStartStatusUpdates

handleStartStatusUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps make at least one 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.


handleStopStatusUpdates

handleStopStatusUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps unsubscribe all IPlayerSessionStatusListener instances for sessionId from interactive component.

Apps must stop sending player session status updates corresponding to sessionId from service compoenent.


handleStartTrackUpdates

handleStartTrackUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps make at least one 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.


handleStopTrackUpdates

handleStopTrackUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps unsubscribe all IPlayerSessionTrackListener instances for sessionId from interactive component.

Apps must stop sending player session track updates corresponding to sessionId from service component.


handleStartMessageUpdates

handleStartMessageUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps make at least one 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.


handleStopMessageUpdates

handleStopMessageUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps unsubscribe all 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.


handleStartErrorUpdates

handleStartErrorUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps make at least one 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.


handleStopErrorUpdates

handleStopErrorUpdates: (sessionId?: IPlayerSessionId) => void

This call is received when apps unsubscribe all 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.


Last updated: Jul 22, 2026