PlaybackEngine

This should be implemented in order to play media.

Properties

Link copied to clipboard
abstract val assetPosition: Float

Gets the current asset position, in seconds, from the active MediaProduct, as Float.

Link copied to clipboard
abstract val events: Flow<Event>

Gets the stream of events describing happenings that consumers may want to react to. Backpressure not handled.

Link copied to clipboard
Link copied to clipboard

Get or set loudnessNormalizationPreAmp as Int to use when playing.

Link copied to clipboard
abstract val mediaProduct: MediaProduct?

Gets the currently active MediaProduct. May be null, most likely if current state is PlaybackState.IDLE.

Link copied to clipboard

Gets the current output device, as OutputDevice.

Link copied to clipboard

Gets the currently active PlaybackContext. May be null, most likely if current state is PlaybackState.IDLE.

Link copied to clipboard

Gets the currently active PlaybackState.

Link copied to clipboard

Get or set AudioQuality to use when streaming over cellular.

Link copied to clipboard

Get or set AudioQuality to use when streaming over WiFi.

Link copied to clipboard

Sets or clears an AspectRatioAdjustingSurfaceView for the player to use for video playback.

Functions

Link copied to clipboard
abstract fun load(mediaProduct: MediaProduct)

Resets playback and immediately transition to set selected MediaProduct. Playback state will immediately change to PlaybackState.NOT_PLAYING. When this call returns, the requested media product is considered the active one.

Link copied to clipboard
abstract fun pause()

Pauses playback of active MediaProduct.

Link copied to clipboard
abstract fun play()

Starts playback of active MediaProduct.

Link copied to clipboard
abstract fun release()

Releases all resources required by this instance exclusively.

Link copied to clipboard
abstract fun reset()

Resets the playback engine to its initial state, effectively a stop action.

Link copied to clipboard
abstract fun seek(time: Float)

Changes asset position in the active media product.

Link copied to clipboard
abstract fun setNext(mediaProduct: MediaProduct?)

Playback makes an implicit transition to the selected MediaProduct once the currently active finishes playing.

Link copied to clipboard
abstract fun setRepeatOne(enable: Boolean)

Sets repeat one mode on or off. Repeat all is handled by the host.

Link copied to clipboard
abstract fun skipToNext()

Changes the currently loaded media product to the one set previously via setNext, implicitly continuing playback if it was ongoing.