MediaSession class

The interface to the Media Session API which 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.

Annotations
  • @JS('navigator.mediaSession')

Constructors

MediaSession()

Properties

hashCode int
The hash code for this object.
no setterinherited
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
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

metadata MediaMetadata
Returns an instance of html.MediaMetadata, which contains rich media metadata for display in a platform UI.
getter/setter pair
playbackState String
Indicates whether the current media session is playing.
getter/setter pair

Static Methods

setActionHandler(String action, MediaSessionActionHandler callback) → void
Sets an action handler for a media session action, such as play or pause.
setPositionState(MediaSessionPositionState? state) → void
Sets the current playback position and speed of the media currently being presented.