AudioPlaybackController

Controller given when entering audio playback mode.

Types

Link copied to clipboard
Listener for audio playback events.

Functions

Link copied to clipboard
Registers a AudioPlaybackListener to get notified when audio playback state changes.
Link copied to clipboard
abstract fun exitAudioPlaybackMode()
Leaves playback mode.
Link copied to clipboard
Returns the audio mode manager from this controller.
Link copied to clipboard
@IntRange(from = 0)
abstract fun getCurrentPosition(): Int
Returns current playback position in milliseconds.
Link copied to clipboard
@IntRange(from = 0)
abstract fun getDuration(): Int
Returns total playback duration in milliseconds.
Link copied to clipboard
abstract fun isReady(): Boolean
Checks whether the media is ready to be played.
Link copied to clipboard
abstract fun isResumed(): Boolean
Checks whether the media playback is currently resumed.
Link copied to clipboard
abstract fun pause()
Pauses playback of the media.
Link copied to clipboard
Link copied to clipboard
abstract fun resume()
Resumes playback of the media.
Link copied to clipboard
abstract fun seekTo(@IntRange(from = 0) offsetMillis: Int)
Seeks to a specified offset in the media.
Link copied to clipboard
open fun toggle()
Toggles audio playback state.