ColibrioMediaSession

Used for controlling the media session, such as:

  • the presented timeline

  • configuring which media commands are available to users

  • which metadata is shown in the media notification

Threading

Call every member of this media session from the main thread. See the Threading section of AudioReadingSystemEngine for what happens when a call arrives from another thread.

Event listeners

Registering the same listener twice has no effect. Removing a listener that is not registered has no effect.

Each event goes to the listeners registered when its dispatch began. You may therefore add or remove listeners from inside a callback. A listener removed during a callback still receives the event being dispatched, and no event after it. A listener added during a callback first receives the next event.

Destroyed and reloading players

This media session belongs to a ColibrioAudioPlayer. Setting metadata or mediaCommands, and calling setMediaSessionTimelineMode, have no effect while that player is destroyed or reloading. Adding or removing a listener has no effect while it is destroyed. The read-only properties keep working in both states.

Properties

Link copied to clipboard

The current active media session timeline section.

Link copied to clipboard

Gets/Sets the media session commands.

Link copied to clipboard

Gets/Sets the media session metadata.

Link copied to clipboard

The media session timeline section after the current active section.

Link copied to clipboard

The media session timeline section before the current active section.

Link copied to clipboard

The current mode used for presenting the media session timeline in the media notification.

Link copied to clipboard

The list of sections if timelineMode is MediaSessionTimelineMode.Sections or null if timelineMode is MediaSessionTimelineMode.FullTimeline.