Properties
handlePlay
handlePlay:Handles a play request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the play request is successfully handled,
or rejects with an error if the request fails.
handlePause
handlePause:Handles a pause request initiated through a media control.(sessionId?:IMediaSessionId, context?:ICommandContext) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.context?
ICommandContext Optional. Additional command context.Returns
Promise<void>
A Promise that resolves when the pause request is successfully handled,
or rejects with an error if the request fails.
handleTogglePlayPause
handleTogglePlayPause:Handles a toggle play pause request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the toggle play pause request is successfully handled,
or rejects with an error if the request fails.
handleStop
handleStop:Handles a stop request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the stop request is successfully handled,
or rejects with an error if the request fails.
handleStartOver
handleStartOver:Handles a start over request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the start over request is successfully handled,
or rejects with an error if the request fails.
handleFastForward
handleFastForward:Handles a fast forward request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the fast forward request is successfully handled,
or rejects with an error if the request fails.
handleRewind
handleRewind:Handles a rewind request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the rewind request is successfully handled,
or rejects with an error if the request fails.
handleSetPlaybackSpeed
handleSetPlaybackSpeed:Handles a set playback speed request initiated through a media control.(speed: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
speed
number
speed to set.
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the set playback speed request is successfully handled,
or rejects with an error if the request fails.
handleSkipForward
handleSkipForward:Handles a skip forward request initiated through a media control.(delta:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
delta
ITimeValue delta to skip forward.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the skip forward request is successfully handled,
or rejects with an error if the request fails.
handleSkipBackward
handleSkipBackward:Handles a skip backward request initiated through a media control.(delta:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
delta
ITimeValue delta to skip backward.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the skip backward request is successfully handled,
or rejects with an error if the request fails.
handleSeek
handleSeek:Handles a seek request initiated through a media control.(position:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
position
ITimeValue position to seek to.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the seek request is successfully handled,
or rejects with an error if the request fails.
handleSetAudioVolume
handleSetAudioVolume:Handles a set audio volume request initiated through a media control.(volume: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
volume
number
volume to set.
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the set audio volume request is successfully handled,
or rejects with an error if the request fails.
handleSetAudioTrack
handleSetAudioTrack:Handles a set audio track request initiated through a media control.(audioTrack:ITrack, sessionId?:IMediaSessionId) => Promise<void>
Parameters
audioTrack
ITrack track to set.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the set audio track request is successfully handled,
or rejects with an error if the request fails.
handleEnableTextTrack
handleEnableTextTrack:Handles an enable text track request initiated through a media control.(textTrack:ITrack, sessionId?:IMediaSessionId) => Promise<void>
Parameters
textTrack
ITrack track to enable.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the enable text track request is successfully handled,
or rejects with an error if the request fails.
handleDisableTextTrack
handleDisableTextTrack:Handles a disable text track request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the disable text track request is successfully handled,
or rejects with an error if the request fails.
handleNext
handleNext:Handles a next request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the next request is successfully handled,
or rejects with an error if the request fails.
handlePrevious
handlePrevious:Handles a previous request initiated through a media control.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the previous request is successfully handled,
or rejects with an error if the request fails.
handleEnableShuffle
handleEnableShuffle:Handles an enable shuffle request initiated through a media control.(enable: boolean, sessionId?:IMediaSessionId) => Promise<void>
Parameters
enable
boolean
enable shuffle.
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the enable shuffle request is successfully handled,
or rejects with an error if the request fails.
handleSetRepeatMode
handleSetRepeatMode:Handles a set repeat mode request initiated through a media control.(mode:RepeatMode, sessionId?:IMediaSessionId) => Promise<void>
Parameters
mode
RepeatMode repeat mode.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the pause set repeat mode is successfully handled,
or rejects with an error if the request fails.
handleSetRating
handleSetRating:Handles a set rating request.(id: MediaId, rating: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
id
MediaId
The ID of the media.
rating
number
The value to set for the rating.
sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the set rating request is successfully handled,
or rejects with an error if the request fails.
handleGetMetadataInfo
handleGetMetadataInfo:Handles a request for the metadata of the specified media item.(id: MediaId) => Promise<IMediaMetadata>
Parameters
id
MediaId
The ID of the media.
Returns
Promise<IMediaMetadata>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
handleCustomAction
handleCustomAction:Handles a request for a custom action.(action:Action, sessionId?:IMediaSessionId) => Promise<void>
Parameters
action
Action The action to perform.sessionId?
IMediaSessionId Optional. The session ID to target with the request.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
handleGetSessionState
handleGetSessionState:Handles a request for the session state.(sessionId?:IMediaSessionId) => Promise<MediaSessionState[]>
Parameters
sessionId?
IMediaSessionId Optional. The session ID of the session whose state is to be fetched. If not provided, treat as a request for data on all sessions.Returns
Promise<MediaSessionState[]>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
