MediaControllerCompat.Callback


public abstract class MediaControllerCompat.Callback implements IBinder.DeathRecipient


Callback for receiving updates on from the session. A Callback can be registered using registerCallback

Summary

Public constructors

Public methods

void
void

Override to handle changes to the audio info.

void
onCaptioningEnabledChanged(boolean enabled)

Override to handle changes to the captioning enabled status.

void

Override to handle changes to the MediaSessionCompat extras.

void

Override to handle changes to the current metadata.

void

Override to handle changes in playback state.

void

Override to handle changes to items in the queue.

void

Override to handle changes to the queue title.

void
onRepeatModeChanged(int repeatMode)

Override to handle changes to the repeat mode.

void

Override to handle the session being destroyed.

void
onSessionEvent(String event, Bundle extras)

Override to handle custom events sent by the session owner without a specified interface.

void

Override to handle the session being ready.

void
onShuffleModeChanged(int shuffleMode)

Override to handle changes to the shuffle mode.

Public constructors

Callback

Added in 1.1.0
public Callback()

Public methods

binderDied

Added in 1.1.0
public void binderDied()

onAudioInfoChanged

Added in 1.1.0
public void onAudioInfoChanged(MediaControllerCompat.PlaybackInfo info)

Override to handle changes to the audio info.

Parameters
MediaControllerCompat.PlaybackInfo info

The current audio info for this session.

onCaptioningEnabledChanged

Added in 1.1.0
public void onCaptioningEnabledChanged(boolean enabled)

Override to handle changes to the captioning enabled status.

Parameters
boolean enabled

true if captioning is enabled, false otherwise.

onExtrasChanged

Added in 1.1.0
public void onExtrasChanged(Bundle extras)

Override to handle changes to the MediaSessionCompat extras.

Parameters
Bundle extras

The extras that can include other information associated with the MediaSessionCompat.

onMetadataChanged

Added in 1.1.0
public void onMetadataChanged(MediaMetadataCompat metadata)

Override to handle changes to the current metadata.

Parameters
MediaMetadataCompat metadata

The current metadata for the session or null if none.

onPlaybackStateChanged

Added in 1.1.0
public void onPlaybackStateChanged(PlaybackStateCompat state)

Override to handle changes in playback state.

Parameters
PlaybackStateCompat state

The new playback state of the session

onQueueChanged

Added in 1.1.0
public void onQueueChanged(List<MediaSessionCompat.QueueItem> queue)

Override to handle changes to items in the queue.

Parameters
List<MediaSessionCompat.QueueItem> queue

A list of items in the current play queue. It should include the currently playing item as well as previous and upcoming items if applicable.

onQueueTitleChanged

Added in 1.1.0
public void onQueueTitleChanged(CharSequence title)

Override to handle changes to the queue title.

Parameters
CharSequence title

The title that should be displayed along with the play queue such as "Now Playing". May be null if there is no such title.

onRepeatModeChanged

Added in 1.1.0
public void onRepeatModeChanged(int repeatMode)

Override to handle changes to the repeat mode.

Parameters
int repeatMode

The repeat mode. It should be one of followings: REPEAT_MODE_NONE, REPEAT_MODE_ONE, REPEAT_MODE_ALL, REPEAT_MODE_GROUP

onSessionDestroyed

Added in 1.1.0
public void onSessionDestroyed()

Override to handle the session being destroyed. The session is no longer valid after this call and calls to it will be ignored.

onSessionEvent

Added in 1.1.0
public void onSessionEvent(String event, Bundle extras)

Override to handle custom events sent by the session owner without a specified interface. Controllers should only handle these for sessions they own.

Parameters
String event

The event from the session.

Bundle extras

Optional parameters for the event.

onSessionReady

Added in 1.1.0
public void onSessionReady()

Override to handle the session being ready.

See also
isSessionReady

onShuffleModeChanged

Added in 1.1.0
public void onShuffleModeChanged(int shuffleMode)

Override to handle changes to the shuffle mode.

Parameters
int shuffleMode

The shuffle mode. Must be one of the followings: SHUFFLE_MODE_NONE, SHUFFLE_MODE_ALL, SHUFFLE_MODE_GROUP