AvailabilityListener

interface AvailabilityListener

This interface is implemented by clients that want to know when the player has determined whether music is available for playback or not.

Only one of the two methods will ever be called, and never more than once. Neither method will be called until the player has tried (successfully or unsuccessfully) to contact the Adaptr servers to retrieve a list of streaming stations.

Note that if this client has previously downloaded music to the local device but the device is now not connected to the Internet, then AvailabilityListener.onPlayerAvailable will be called and stationList will be empty while localOfflineStationList will contain entries.

Functions

onPlayerAvailable
Link copied to clipboard
abstract fun onPlayerAvailable(player: AdaptrPlayer)

Called when music is available to the player.

onPlayerUnavailable
Link copied to clipboard
abstract fun onPlayerUnavailable(e: Exception)

Called when music is not available for some reason, like playback location not supported due to music license restrictions or lack of network connectivity.