PlayerRepository

interface PlayerRepository

Functions

addMedia
Link copied to clipboard
abstract fun addMedia(media: Media)
Adds a Media to the end of the playlist.
abstract fun addMedia(index: Int, media: Media)
Adds a Media at the given index of the playlist.
clearMediaList
Link copied to clipboard
abstract fun clearMediaList()
Clears the playlist.
getCurrentMediaIndex
Link copied to clipboard
abstract fun getCurrentMediaIndex(): Int
Returns the index of the current Media.
getMediaAt
Link copied to clipboard
abstract fun getMediaAt(index: Int): Media?
Returns the Media at the given index.
getMediaCount
Link copied to clipboard
abstract fun getMediaCount(): Int
Returns the number of Media in the playlist.
getSeekBackIncrement
Link copied to clipboard
abstract fun getSeekBackIncrement(): Duration
Returns the seekBack increment.
getSeekForwardIncrement
Link copied to clipboard
abstract fun getSeekForwardIncrement(): Duration
Returns the seekForward increment.
hasNextMedia
Link copied to clipboard
abstract fun hasNextMedia(): Boolean
Returns whether a next Media exists.
hasPreviousMedia
Link copied to clipboard
abstract fun hasPreviousMedia(): Boolean
Returns whether a previous Media exists.
pause
Link copied to clipboard
abstract fun pause()
Pauses playback.
play
Link copied to clipboard
abstract fun play()
Resumes playback as soon as player is ready.
prepare
Link copied to clipboard
abstract fun prepare()
Prepares the player.
release
Link copied to clipboard
abstract fun release()
Releases the player.
removeMedia
Link copied to clipboard
abstract fun removeMedia(index: Int)
Removes the Media at the given index of the playlist.
seekBack
Link copied to clipboard
abstract fun seekBack()
Seeks back in the current media by seek back increment.
seekForward
Link copied to clipboard
abstract fun seekForward()
Seek forward in the current media by seek forward increment.
seekToDefaultPosition
Link copied to clipboard
abstract fun seekToDefaultPosition(mediaIndex: Int)
Seeks to the default position associated with the specified Media.
setMedia
Link copied to clipboard
abstract fun setMedia(media: Media)
Clears the playlist, adds the specified Media and resets the position to the default position.
setMediaList
Link copied to clipboard
abstract fun setMediaList(mediaList: List<Media>)
Clears the playlist, adds the specified Media list and resets the position to the default position.
setMediaListAndPlay
Link copied to clipboard
abstract fun setMediaListAndPlay(mediaList: List<Media>, index: Int)
Clears the playlist, adds the specified Media list and plays the Media at the position of the index passed as param.
setShuffleModeEnabled
Link copied to clipboard
abstract fun setShuffleModeEnabled(shuffleModeEnabled: Boolean)
Sets whether shuffling of Media is enabled.
skipToNextMedia
Link copied to clipboard
abstract fun skipToNextMedia()
Skips to the default position of next Media.
skipToPreviousMedia
Link copied to clipboard
abstract fun skipToPreviousMedia()
Skips to the default position of previous Media.

Properties

availableCommands
Link copied to clipboard
abstract val availableCommands: StateFlow<Set<Command>>
Returns the player's currently available commands.
connected
Link copied to clipboard
abstract val connected: StateFlow<Boolean>
Returns whether the repository is currently connected to a working Player.
currentMedia
Link copied to clipboard
abstract val currentMedia: StateFlow<Media?>
Returns the current Media playing, or that would play when player starts playing.
currentState
Link copied to clipboard
abstract val currentState: StateFlow<PlayerState>
Returns the player's current state.
mediaPosition
Link copied to clipboard
abstract val mediaPosition: StateFlow<MediaPosition?>
Returns the current media position of the player.
shuffleModeEnabled
Link copied to clipboard
abstract val shuffleModeEnabled: StateFlow<Boolean>
Returns the current value for shuffling of Media mode.