Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.
added in version 22.1.0
belongs to Maven artifact androidx.media:media:1.0.0-rc01

MediaControllerCompat.Callback

public static abstract class MediaControllerCompat.Callback
extends Object implements IBinder.DeathRecipient

java.lang.Object
   ↳ android.support.v4.media.session.MediaControllerCompat.Callback


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

Summary

Public constructors

MediaControllerCompat.Callback()

Public methods

void binderDied()
void onAudioInfoChanged(MediaControllerCompat.PlaybackInfo info)

Override to handle changes to the audio info.

void onCaptioningEnabledChanged(boolean enabled)

Override to handle changes to the captioning enabled status.

void onExtrasChanged(Bundle extras)

Override to handle changes to the MediaSessionCompat extras.

void onMetadataChanged(MediaMetadataCompat metadata)

Override to handle changes to the current metadata.

void onPlaybackStateChanged(PlaybackStateCompat state)

Override to handle changes in playback state.

void onQueueChanged(List<MediaSessionCompat.QueueItem> queue)

Override to handle changes to items in the queue.

void onQueueTitleChanged(CharSequence title)

Override to handle changes to the queue title.

void onRepeatModeChanged(int repeatMode)

Override to handle changes to the repeat mode.

void onSessionDestroyed()

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 onSessionReady()

Override to handle the session being ready.

void onShuffleModeChanged(int shuffleMode)

Override to handle changes to the shuffle mode.

Inherited methods

Public constructors

MediaControllerCompat.Callback

added in version 22.1.0
public MediaControllerCompat.Callback ()

Public methods

binderDied

added in version 22.1.0
public void binderDied ()

onAudioInfoChanged

added in version 22.1.0
public void onAudioInfoChanged (MediaControllerCompat.PlaybackInfo info)

Override to handle changes to the audio info.

Parameters
info MediaControllerCompat.PlaybackInfo: The current audio info for this session.

onCaptioningEnabledChanged

added in version 25.4.0
public void onCaptioningEnabledChanged (boolean enabled)

Override to handle changes to the captioning enabled status.

Parameters
enabled boolean: true if captioning is enabled, false otherwise.

onExtrasChanged

added in version 22.1.0
public void onExtrasChanged (Bundle extras)

Override to handle changes to the MediaSessionCompat extras.

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

onMetadataChanged

added in version 22.1.0
public void onMetadataChanged (MediaMetadataCompat metadata)

Override to handle changes to the current metadata.

Parameters
metadata MediaMetadataCompat: The current metadata for the session or null if none.

onPlaybackStateChanged

added in version 22.1.0
public void onPlaybackStateChanged (PlaybackStateCompat state)

Override to handle changes in playback state.

Parameters
state PlaybackStateCompat: The new playback state of the session

onQueueChanged

added in version 22.1.0
public void onQueueChanged (List<MediaSessionCompat.QueueItem> queue)

Override to handle changes to items in the queue.

Parameters
queue List: 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 version 22.1.0
public void onQueueTitleChanged (CharSequence title)

Override to handle changes to the queue title.

Parameters
title CharSequence: 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 version 25.4.0
public void onRepeatModeChanged (int repeatMode)

Override to handle changes to the repeat mode.

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

onSessionDestroyed

added in version 22.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 version 22.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
event String: The event from the session.

extras Bundle: Optional parameters for the event.

onSessionReady

added in version 1.0.0
public void onSessionReady ()

Override to handle the session being ready.

onShuffleModeChanged

added in version 26.1.0
public void onShuffleModeChanged (int shuffleMode)

Override to handle changes to the shuffle mode.

Parameters
shuffleMode int: The shuffle mode. Must be one of the followings: PlaybackStateCompat.SHUFFLE_MODE_NONE, PlaybackStateCompat.SHUFFLE_MODE_ALL, PlaybackStateCompat.SHUFFLE_MODE_GROUP