ColibrioAudioPlayer

Used for controlling and configuring native audio playback.

Players are created and managed by the ColibrioMediaService.

Note that there can only be one ColibrioAudioPlayer at a time. If another one is created either by using ReadingSystemEngine.createSyncMediaPlayer with a SyncMediaAudioRenderer.NativeAudioRenderer or by using ColibrioMediaService.createAudioPlayer, the existing one will be destroyed.

Functions

Link copied to clipboard

Adds an instance of OnMediaPlayerEventListener to the player.

Link copied to clipboard
abstract fun destroy()

Destroys this ColibrioAudioPlayer instance, which results in ignoring all subsequent calls to its methods. This method does nothing if already destroyed.

Link copied to clipboard
abstract fun pause()

Pauses media playback.

Link copied to clipboard
abstract fun play()

Attempts to resume playback from the current timeline position as soon as the player is ready. The player will pause if it fails to resume playback.

Link copied to clipboard

Removes an instance of OnMediaPlayerEventListener from the player.

Link copied to clipboard
abstract fun seekToApproximateTimeMs(timeInMs: Int)

Seeks to the approximate time from timeline start in milliseconds.

Link copied to clipboard
abstract fun seekToNextSegment()

Seeks to the next segment in the timeline, if such segment exists.

Link copied to clipboard
abstract fun seekToPreviousSegment()

Seeks to the previous segment in the timeline, if such segment exists.

Link copied to clipboard

Seeks to the given position in the timeline.

Link copied to clipboard
abstract fun setMediaCommands(mediaCommands: ColibrioMediaCommands)

Updates the media commands.

Link copied to clipboard
abstract fun setMediaSessionMetadata(mediaSessionMetadata: ColibrioMediaSessionMetadata)

Updates the media session metadata.

Properties

Link copied to clipboard

Gets the approximate elapsed time from timeline start to current position in milliseconds.

Link copied to clipboard
abstract val atEnd: Boolean

If the player has reached the end of the timeline.

Link copied to clipboard
abstract val atStart: Boolean

If the player is at the start of the timeline.

Link copied to clipboard
abstract val destroyed: Boolean

True if this player has been destroyed. In that case, any calls to its methods will be ignored.

Link copied to clipboard
abstract var muted: Boolean

Gets/sets if audio should be muted.

Link copied to clipboard
abstract val paused: Boolean

If the player is currently in paused state

Link copied to clipboard
abstract var playbackRate: Double

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.

Link copied to clipboard
abstract val ready: Boolean

Returns true if the player is ready to play. Returns false if the player is currently seeking or waiting for data to be loaded.

Link copied to clipboard
abstract val seeking: Boolean

Returns true if the player is currently seeking to a new timeline position

Link copied to clipboard

The current timeline position of the player

Link copied to clipboard
abstract val totalDurationMs: Int

The total duration of the timeline in milliseconds

Link copied to clipboard
abstract var volume: Double

Gets/sets the volume as a value between 0.0 and 1.0.