Properties
play
play:Sends a play request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
pause
pause:Sends a pause requst on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
togglePlayPause
togglePlayPause:Sends a togglePlayPause request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
stop
stop:Sends a stop request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
startOver
startOver:Sends a startOver request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
fastForward
fastForward:Sends a fastForward request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
rewind
rewind:Sends a rewind request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
setPlaybackSpeed
setPlaybackSpeed:Sends a setPlaybackSpeed request on the media control endpoint.(speed: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
speed
number
speed to set.
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
skipForward
skipForward:Sends a skipForward request on the media control endpoint.(delta:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
delta
ITimeValue The time delta to skip forward.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
skipBackward
skipBackward:Sends a skipBackward request on the media control endpoint.(delta:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
delta
ITimeValue The time delta to skip backward.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
seek
seek:Sends a seek request on the media control endpoint.(position:ITimeValue, sessionId?:IMediaSessionId) => Promise<void>
Parameters
position
ITimeValue The time position to seek to.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
setAudioVolume
setAudioVolume:Sends a set audio volume request on the media control endpoint.(volume: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
volume
number
The volume level to set.
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
setAudioTrack
setAudioTrack:Sends a setAudioTrack requst on the media control endpoint.(track:ITrack, sessionId?:IMediaSessionId) => Promise<void>
Parameters
track
ITrack The track to set.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
enableTextTrack
enableTextTrack:Sends a enableTextTrack request on the media control endpoint.(track:ITrack, sessionId?:IMediaSessionId) => Promise<void>
Parameters
track
ITrack The track to enable.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
disableTextTrack
disableTextTrack:Sends a disableTextTrack request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
next
next:Sends a next request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
previous
previous:Sends a previous request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<void>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
enableShuffle
enableShuffle:Sends a enableShuffle request on the media control endpoint.(enable: boolean, sessionId?:IMediaSessionId) => Promise<void>
Parameters
enable
boolean
When set to true shuffle is enabled; otherwise false.
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
setRepeatMode
setRepeatMode:Sends a setRepeatMode request on the media control endpoint.(mode:RepeatMode, sessionId?:IMediaSessionId) => Promise<void>
Parameters
mode
RepeatMode The mode to set.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
setRating
setRating:Sends a setRating request on the media control endpoint.(id: MediaId, rating: number, sessionId?:IMediaSessionId) => Promise<void>
Parameters
id
MediaId
The ID of the media.
rating
number
The rating to set.
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
getMetadata
getMetadata:Sends a getMetadata request on the media control endpoint.(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.
sendCustomAction
sendCustomAction:Sends a sendCustomAction request on the media control endpoint.(action:Action, sessionId?:IMediaSessionId) => Promise<void>
Parameters
action
Action The action to send.sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the session to target is decided by the endpoint.Returns
Promise<void>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
getSessionState
getSessionState:Sends a getSessionState request on the media control endpoint.(sessionId?:IMediaSessionId) => Promise<MediaSessionState[]>
Parameters
sessionId?
IMediaSessionId Optional. The session ID to target with the request. If not provided, the request is interpretted to be for all available sessions.Returns
Promise<MediaSessionState[]>
A Promise that resolves when the request is successfully handled,
or rejects with an error if the request fails.
getEndpointPackageId
getEndpointPackageId: () => IPackageId
Gets the package ID of this endpoint.
Returns
IPackageId The package ID.addListener
addListener:Subscribes a listener to monitor changes in the media session state.(listener:IMediaControlListener) => Promise<ISubscription>
Parameters
listener
IMediaControlListener The listener to add.Returns
Promise<ISubscription>
A Promise that resolves with an ISubscription object. This object can be used
to unsubscribe the listener when it’s no longer needed.
destroy
destroy: () => void
Destroys the media control client asynchronously.
