Colibrio Media Session
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
The media session timeline section containing the current playback position.
Gets/Sets the media session commands.
Gets/Sets the media session metadata.
The media session timeline section after the current active section.
The media session timeline section before the current active section.
The current mode used for presenting the media session timeline in the media notification.
The list of sections if timelineMode is MediaSessionTimelineMode.Sections or null if timelineMode is MediaSessionTimelineMode.FullTimeline.
Functions
Adds an instance of MediaSessionTimelineSectionChangedListener.
Removes an instance of MediaSessionTimelineSectionChangedListener.
Set the mode for displaying duration in the media session.