setActionHandler method

void setActionHandler(
  1. MediaSessionAction action,
  2. MediaSessionActionHandler? handler
)

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.

Implementation

external void setActionHandler(
  MediaSessionAction action,
  MediaSessionActionHandler? handler,
);