play

fun play()

Start music playback. Will begin playback if there is any music in the queue. This should only be called to resume music playback. The music should be set using overloads of play. Even if prepareToPlay() has been called earlier, the music may or may not start immediately when this function is called. To be sure that playback will start when this function is called, user should wait for onPlayItemReadyForPlayback callback in MusicQueuedListener before calling this function.

fun play(audioFile: AudioFile, withCrossfade: Boolean = false)

Begin playback of a specific onDemand song.

See also

getPlayQueueEditor

()

Parameters

audioFile

AudioFile

fun play(audioFiles: List<AudioFile>, startIndex: Int = 0, withCrossfade: Boolean = false)

Begin playback of on Demand list.

See also

getPlayQueueEditor

() to edit the play queue

Parameters

audioFiles

List

withCrossfade

Boolean

startIndex

index from which to begin playback. Starts at 0.

fun play(station: Station, withCrossfade: Boolean = false)

Play the given station, with optional crossfade between the current song and the song in the new station.

If withCrossfade is true, then the server first retrieves enough of the first song in the new active station to begin playback, then it begins fading out the current song while starting the new song.

Parameters

station

Station

withCrossfade

If true, the current song will fade out, rather than stop, when the new station starts playback.