ExoMixingAudioPlayer

class ExoMixingAudioPlayer(context: Context, looper: Looper) : MixingAudioPlayer

TODO: volume ramp goes out of whack if you pause during crossfade if the player volume is adjusted during a crossfade, the faders don't take that new volume into account. can the player be paused while stalled or buffering? a song either fails to prepare or starts and then either errors out or completes

Constructors

ExoMixingAudioPlayer
Link copied to clipboard
fun ExoMixingAudioPlayer(context: Context, listener: MixingAudioPlayer.EventListener, looper: Looper)

Creates new instance of, with a Context that is provided to the ExoPlayer instances. The player starts out in the READY_TO_PLAY state.

ExoMixingAudioPlayer
Link copied to clipboard
fun ExoMixingAudioPlayer(context: Context, looper: Looper)

Types

Companion
Link copied to clipboard
object Companion
PlayAndPlayer
Link copied to clipboard
inner class PlayAndPlayer
TimeTracker
Link copied to clipboard
inner class TimeTracker(id: String)

Functions

addAudioAsset
Link copied to clipboard
open override fun addAudioAsset(audioFile: Play)

Add an Audio file to the playlist.

cacheMedia
Link copied to clipboard
open override fun cacheMedia(url: String, maxCache: Int, listener: CacheMediaListener)
destroy
Link copied to clipboard
open override fun destroy()
flush
Link copied to clipboard
open override fun flush()

Stops all playback and clears all items added to the playlist

flushAndIncludeCurrent
Link copied to clipboard
open override fun flushAndIncludeCurrent(includeCurrent: Boolean)

Flushes any pending items in the playlist but not the current song

maxSeekableLengthInSeconds
Link copied to clipboard
open override fun maxSeekableLengthInSeconds(): Float
pause
Link copied to clipboard
open override fun pause()

Pause current playback

play
Link copied to clipboard
open override fun play()

Starts or resumes playback

prepareTrack
Link copied to clipboard
open override fun prepareTrack(file: Play)
resetToBeginning
Link copied to clipboard
fun resetToBeginning()
seekTo
Link copied to clipboard
open override fun seekTo(position: Float)

Seek current song to this duration.

setMixingAudioPlayerEventListener
Link copied to clipboard
fun setMixingAudioPlayerEventListener(listener: MixingAudioPlayer.EventListener?)

Event listener for Mixing Audio Player. Any previously assigned listener is removed.

setTrimmingEnabled
Link copied to clipboard
fun setTrimmingEnabled(enabled: Boolean)
skip
Link copied to clipboard
open override fun skip()

Skip current song

skipWithCrossFade
Link copied to clipboard
open override fun skipWithCrossFade()
toString
Link copied to clipboard
open override fun toString(): String

Properties

bTrimmingEnabled
Link copied to clipboard
open override var bTrimmingEnabled: Boolean = false

Enable or disable audio trimming

context
Link copied to clipboard
val context: Context
crossFadeInEnabled
Link copied to clipboard
var crossFadeInEnabled: Boolean = true

When true, new songs fade in rather than start at full volume

currentPlay
Link copied to clipboard
open override var currentPlay: Play?

Returns currently Playing Song or null

currentPlayDuration
Link copied to clipboard
open override val currentPlayDuration: Float

Get duration of current song

currentPlayTime
Link copied to clipboard
open override val currentPlayTime: Float

Get current play time in Seconds

fadeDuration
Link copied to clipboard
open override var fadeDuration: Float

Set CrossFade Duration in Seconds

mEventListener
Link copied to clipboard
open override var mEventListener: MixingAudioPlayer.EventListener? = null
state
Link copied to clipboard
open override var state: State

Get current state of ExoMixingAudio Player.

volume
Link copied to clipboard
open override var volume: Float = 1f

Set the playback volume, the value should be between 0 and 1