interface MediaControlAPI {
    setEnabled(enabled): void;
    setHandler(action, handler): void;
}

Methods

  • Enables or disables the media session for this player instance at runtime.

    Parameters

    • enabled: boolean

      Whether the media session should be enabled for this player.

    Returns void

    Remarks


    - This overrides the MediaControlConfiguration.mediaSessionEnabled value passed at creation time.
    - When multiple players are active, this can be used to designate a single "active" player that publishes media metadata (e.g. Now Playing info) and responds to remote control commands, while disabling the others.

  • Sets a handler for a media control action.

    Parameters

    • action: MediaControlAction

      The media control action to set the handler for.

    • handler: undefined | MediaControlHandler

      The handler function that will be called when the specified media control action is triggered. The handler receives the THEOplayer instance as an argument. Passing undefined removes any previously set handler for the action, restoring the player's default behaviour.

    Returns void