@nextcloud/dialogs
    Preparing search index...

    Interface MediaSession

    The MediaSession interface of the Media Session API allows a web page to provide custom behaviors for standard media playback interactions, and to report metadata that can be sent by the user agent to the device or operating system for presentation in standardized user interface elements.

    MDN Reference

    interface MediaSession {
        metadata: MediaMetadata | null;
        playbackState: MediaSessionPlaybackState;
        setActionHandler(
            action: MediaSessionAction,
            handler: MediaSessionActionHandler | null,
        ): void;
        setCameraActive(active: boolean): Promise<void>;
        setMicrophoneActive(active: boolean): Promise<void>;
        setPositionState(state?: MediaPositionState): void;
    }
    Index

    Properties

    metadata: MediaMetadata | null

    The metadata property of the MediaSession interface contains a MediaMetadata object providing descriptive information about the currently playing media, or null if the metadata has not been set. This metadata is provided by the browser to the device for presentation in any standard media control user interface the device might offer.

    MDN Reference

    The playbackState property of the MediaSession interface indicates whether the current media session is playing or paused.

    MDN Reference

    Methods

    • The setActionHandler() method of the MediaSession interface sets a handler for a media session action. These actions let a web app receive notifications when the user engages a device's built-in physical or onscreen media controls, such as play, stop, or seek buttons.

      MDN Reference

      Parameters

      Returns void

    • The setCameraActive() method of the MediaSession interface is used to indicate to the user agent whether the user's camera is considered to be active.

      MDN Reference

      Parameters

      • active: boolean

      Returns Promise<void>

    • The setMicrophoneActive() method of the MediaSession interface is used to indicate to the user agent whether the user's microphone is considered to be currently muted.

      MDN Reference

      Parameters

      • active: boolean

      Returns Promise<void>

    • The setPositionState() method of the MediaSession interface is used to update the current document's media playback position and speed for presentation by user's device in any kind of interface that provides details about ongoing media. This can be particularly useful if your code implements a player for type of media not directly supported by the browser.

      MDN Reference

      Parameters

      Returns void