MediaSession extension type

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.

For example, a smartphone might have a standard panel in its lock screen that provides controls for media playback and information display. A browser on the device can use MediaSession to make browser playback controllable from that standard/global user interface.


API documentation sourced from MDN Web Docs.

on
Implemented types
Available extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
metadata MediaMetadata?
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.
getter/setter pair
playbackState MediaSessionPlaybackState
The playbackState property of the MediaSession interface indicates whether the current media session is playing or paused.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setActionHandler(MediaSessionAction action, MediaSessionActionHandler? handler) → void
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.
setPositionState([MediaPositionState state]) → 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.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited