MediaControllerCompat.Callback


abstract class MediaControllerCompat.Callback : IBinder.DeathRecipient


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

Summary

Public constructors

Public functions

Unit
Unit

Override to handle changes to the audio info.

Unit

Override to handle changes to the captioning enabled status.

Unit

Override to handle changes to the MediaSessionCompat extras.

Unit

Override to handle changes to the current metadata.

Unit

Override to handle changes in playback state.

Unit

Override to handle changes to items in the queue.

Unit

Override to handle changes to the queue title.

Unit
onRepeatModeChanged(repeatMode: Int)

Override to handle changes to the repeat mode.

Unit

Override to handle the session being destroyed.

Unit
onSessionEvent(event: String!, extras: Bundle!)

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

Unit

Override to handle the session being ready.

Unit
onShuffleModeChanged(shuffleMode: Int)

Override to handle changes to the shuffle mode.

Public constructors

Callback

Added in 1.1.0
Callback()

Public functions

binderDied

Added in 1.1.0
fun binderDied(): Unit

onAudioInfoChanged

Added in 1.1.0
fun onAudioInfoChanged(info: MediaControllerCompat.PlaybackInfo!): Unit

Override to handle changes to the audio info.

Parameters
info: MediaControllerCompat.PlaybackInfo!

The current audio info for this session.

onCaptioningEnabledChanged

Added in 1.1.0
fun onCaptioningEnabledChanged(enabled: Boolean): Unit

Override to handle changes to the captioning enabled status.

Parameters
enabled: Boolean

true if captioning is enabled, false otherwise.

onExtrasChanged

Added in 1.1.0
fun onExtrasChanged(extras: Bundle!): Unit

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 1.1.0
fun onMetadataChanged(metadata: MediaMetadataCompat!): Unit

Override to handle changes to the current metadata.

Parameters
metadata: MediaMetadataCompat!

The current metadata for the session or null if none.

onPlaybackStateChanged

Added in 1.1.0
fun onPlaybackStateChanged(state: PlaybackStateCompat!): Unit

Override to handle changes in playback state.

Parameters
state: PlaybackStateCompat!

The new playback state of the session

onQueueChanged

Added in 1.1.0
fun onQueueChanged(queue: (Mutable)List<MediaSessionCompat.QueueItem!>!): Unit

Override to handle changes to items in the queue.

Parameters
queue: (Mutable)List<MediaSessionCompat.QueueItem!>!

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
fun onQueueTitleChanged(title: CharSequence!): Unit

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 1.1.0
fun onRepeatModeChanged(repeatMode: Int): Unit

Override to handle changes to the repeat mode.

Parameters
repeatMode: Int

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
fun onSessionDestroyed(): Unit

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
fun onSessionEvent(event: String!, extras: Bundle!): Unit

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 1.1.0
fun onSessionReady(): Unit

Override to handle the session being ready.

See also
isSessionReady

onShuffleModeChanged

Added in 1.1.0
fun onShuffleModeChanged(shuffleMode: Int): Unit

Override to handle changes to the shuffle mode.

Parameters
shuffleMode: Int

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