MediaPlayerHolder

Author: @Jeluchu

This class is used to play music with MediaPlayer

Once the MediaPlayer is released, it can't be used again, and another one has to be created. In the onStop() method of the Activity the MediaPlayer is released. Then in the onStart() of the Activity a new MediaPlayer object has to be created. That's why this method is private, and called by load(int) and not the constructor.

References PlayerAdapter and PlaybackInfoListener

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val currentProgress: Float
Link copied to clipboard
open override val currentTime: String
Link copied to clipboard
open override val isPlaying: Boolean
Link copied to clipboard
open override val totalTime: String

Functions

Link copied to clipboard
open override fun initializeProgressCallback()
Link copied to clipboard
open override fun loadMedia(mp3Link: String)
Link copied to clipboard
open override fun pause()
Link copied to clipboard
open override fun play()
Link copied to clipboard
open override fun release()
Link copied to clipboard
open override fun reset()
Link copied to clipboard
open override fun seekTo(position: Int)
Link copied to clipboard
Link copied to clipboard
open override fun stop()
Link copied to clipboard
open override fun togglePlaying(isPlaying: Boolean)