AdaptrPlayer

fun AdaptrPlayer(context: Context, token: String, secret: String)

Create an instance of the player.

This constructor should only be used if music will not be played in the background and a Service and Notification is not required. If you do want music playback to be attached to an Android Service so music continues while an app is backgrounded, then look at Adaptr.

Construction of the FeedAudioPlayer kicks off a background task to contact the Adaptr servers to retrieve a list of available streaming stations.

Note that when you are done with the FeedAudioPlayer instance, you should call stop to free up any audio resources in use by the player before you null out your reference to it.

See also

Parameters

context

Application context

token

token value provided by Adaptr

secret

secret value provided by Adaptr

fun AdaptrPlayer(context: Context, token: String, secret: String, availabilityListener: AvailabilityListener)

Create a new instance of the player, and register an AvailabilityListener to receive notice when the Adaptr servers have been contacted and streaming music is found to be available or not.

Note that when you are done with the FeedAudioPlayer instance, you should call stop to free up any audio resources in use by the player before you null out your reference to it.

See also

Parameters

context

Application context

token

token value provided by Adaptr

secret

secret value provided by Adaptr

availabilityListener

AvailabilityListener, this listener will be automatically removed after first callback.

fun AdaptrPlayer(context: Context, token: String, secret: String, availabilityListener: AvailabilityListener, mockLocation: MockLocations)

Create a new instance of the player with an AvailabilityListener, and optionally ensure all player methods run in a background thread.

Note that when you are done with the FeedAudioPlayer instance, you should call stop to free up any audio resources in use by the player before you null out your reference to it.

See also

Parameters

context

Application context

token

token value provided by Adaptr

secret

secret value provided by Adaptr

availabilityListener

AvailabilityListener, this listener will be automatically removed after first callback.

mockLocation

Temporary testing location to send to feedfm servers.