MediaSessionLike
The subset of the navigator.mediaSession API used by
createMediaSession, so that an equivalent implementation can be
injected, e.g. in tests.
Properties
Methods
setActionHandler()
setActionHandler(action, handler): void;
Register, or unregister when the handler is null, a handler for the
given media session action.
Parameters
| Parameter | Type |
|---|---|
action | ExtendedMediaSessionAction |
handler | MediaSessionActionHandler | null |
Returns
void
setCameraActive()?
optional setCameraActive(active): Promise<void>;
Tell the user agent whether the camera is considered to be active.
P.S. Safari's impl. is an imperative action to change the track's muted stated whereas Chromium-based browsers indicate to the user agent the microphone capture state desired by the page
Parameters
| Parameter | Type |
|---|---|
active | boolean |
Returns
Promise<void>
setMicrophoneActive()?
optional setMicrophoneActive(active): Promise<void>;
Tell the user agent whether the microphone is considered to be active.
P.S. Safari's impl. is an imperative action to change the track's muted stated whereas Chromium-based browsers indicate to the user agent the microphone capture state desired by the page
Parameters
| Parameter | Type |
|---|---|
active | boolean |
Returns
Promise<void>
setScreenshareActive()?
optional setScreenshareActive(active): Promise<void>;
Tell the user agent whether the screen is considered to be shared. Only specified so far, no browser implements it yet.
Parameters
| Parameter | Type |
|---|---|
active | boolean |
Returns
Promise<void>
setPositionState()?
optional setPositionState(state?): void;
Present the playback position, or reset it when called without a state.
Throws a TypeError for a state the user agent considers invalid.
Parameters
| Parameter | Type |
|---|---|
state? | MediaPositionState |
Returns
void