MediaSessionInit
Options to create a media session.
Properties
| Property | Type | Description |
|---|---|---|
handlers? | Partial<Record<ExtendedMediaSessionAction, MediaSessionActionHandler>> | Handlers to register, keyed by the action they handle. Actions without a handler are left untouched, allowing the platform to fall back to its default behavior. |
metadata? | MediaSessionMetadataInit | Initial metadata to present. |
playbackState? | MediaSessionPlaybackState | Initial playback state, defaults to playing. |
positionState? | MediaPositionState | Initial playback position to present. |
applyImperativeCaptureState? | boolean | Apply the capture state even when the platform implements it as a command that mutes the real tracks, defaults to false. Only enable this when every call is made from a user gesture handler, otherwise unmuting is rejected and the capture stays muted. |
mediaSession? | MediaSessionLike | The media session implementation to use, defaults to navigator.mediaSession when available. |
createMetadata? | (init) => MediaMetadata | Factory building the metadata object, defaults to the MediaMetadata constructor when available. |