Colibrio Audio Player
Used for controlling and configuring native audio playback.
Players are created and managed by the AudioReadingSystemEngine.
Note that there can only be one ColibrioAudioPlayer at a time: AudioReadingSystemEngine.createAudioPlayer destroys the existing player before it creates the next one. To synchronize a player with a ReaderView, pass it to ReadingSystemEngine.createSyncMediaPlayer and attach the SyncMediaPlayer it returns. While that SyncMediaPlayer exists it is what drives playback, so control the audio through it rather than through this player; once you destroy it with ReadingSystemEngine.destroySyncMediaPlayer, use this player's own members again.
A player depends on a live connection to the audio playback service. If that connection is lost, the player cannot recover it and its methods will keep failing; create a new one with AudioReadingSystemEngine.createAudioPlayer.
Threading
Call every member of this player from the main thread; do that and OnMediaPlayerEventListener callbacks arrive on it too. 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.
Adding a listener to a destroyed player has no effect.
Properties
Gets the approximate elapsed time from timeline start to current position in milliseconds.
AudioTimeline instance used to create this player.
Controls which media playback controls are available and how metadata information is presented in the media session notification.
Gets/sets the playback rate. This must be a value between 0.25 and 5.0, where 1.0 is "normal speed". Values lower than 1.0 make the media play slower than normal, higher values make it play faster.
The current timeline position of the player
The total duration of the timeline in milliseconds
Returns true if the player is waiting to become synchronized with the ReaderView, false otherwise.
Functions
Adds an instance of OnMediaPlayerEventListener to the player.
Destroys this ColibrioAudioPlayer instance, which results in ignoring all subsequent calls to its methods. This method does nothing if already destroyed.
Removes an instance of OnMediaPlayerEventListener from the player.
Seeks to the approximate time from timeline start in milliseconds.
Seeks to the next segment in the timeline, if such segment exists.
Seeks to the previous segment in the timeline, if such segment exists.
Seeks to the given position in the timeline.
Updates the media commands.
Updates the media session metadata.