getPlayerInstance

fun getPlayerInstance(): AdaptrPlayer

This methods provides a way to get a reference to the singleton FeedAudioPlayer that was created from the initialize() method. This method returns the FeedAudioPlayer instantly irrespective of whether the player is ready or not.

Unless you are supporting offline music playback, we recommend you use the

Return

shared Instance of FeedAudioPlayer.

fun getPlayerInstance(listener: AvailabilityListener)

This methods provides a way to get a reference to the AdaptrPlayer that was created from the initialize method, but only once the AdaptrPlayer has determined music is available to the client or not. This method returns the AdaptrPlayer via the AvailabilityListener to emphasize that that the player is not useful until the Adaptr servers are contacted and music is deemed available to this client.

This is the preferred way to get a reference to the singleton player, but if you are supporting offline playback, you might use the alternate getPlayerInstance method to get access to offline stations without having to wait for the SDK to contact (or fail to contact) the Adaptr servers.

Parameters

listener

The listener to be called when player is available or unavailable, this listener will be automatically removed after first callback.