MediaManager

Manages media playback

Inheritors

Types

Link copied to clipboard
sealed class Event

Events detected by MediaManager

Properties

Link copied to clipboard
abstract val currentVolume: Flow<Float>

The volume of the audio playback. A value of 0.0 indicates silence; a value of 1.0 (the default) indicates full audio volume for the player instance.

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

A Flow of all the Event detected by the media manager

Functions

Link copied to clipboard
abstract fun close()

Releases all resources associated with the media manager. This method should be called when done with the media manager. After calling this playback is disabled. Any subsequent calls will result in a PlaybackError.PlaybackHasEnded

Link copied to clipboard
abstract suspend fun createPlayableMedia(source: MediaSource): PlayableMedia?

Attempts to create a PlayableMedia for a given MediaSource

Link copied to clipboard
abstract fun initialize(playableMedia: PlayableMedia)

Initializes to manage for a given PlayableMedia

Link copied to clipboard
abstract fun pause()

Pauses playback

Link copied to clipboard
abstract fun play(rate: Float)

Starts playback at a given rate

Link copied to clipboard
abstract suspend fun renderVideoOnSurface(surface: MediaSurface?)

Renders the video component of any initialized PlayableMedia on a MediaSurface

Link copied to clipboard
abstract fun reset()

Resets the media manager to an uninitialized state. After calling this initialize will have to be called again.

Link copied to clipboard
abstract suspend fun seekTo(duration: Duration): Boolean

Seeks to a specified time position. Will suspend until seek has completed

Link copied to clipboard
abstract fun stop()

Stops playback

Link copied to clipboard
abstract suspend fun updateVolume(volume: Float)

Updates the currentVolume