Most visited

Recently visited

Added in API level 21

MediaController.Callback

public static abstract class MediaController.Callback
extends Object

java.lang.Object
   ↳ android.media.session.MediaController.Callback


从会话接收更新的回调。 回拨可以使用registerCallback(MediaController.Callback)注册。

Summary

Public constructors

MediaController.Callback()

Public methods

void onAudioInfoChanged(MediaController.PlaybackInfo info)

覆盖以处理对音频信息的更改。

void onExtrasChanged(Bundle extras)

重写以处理对 MediaSession演员的更改。

void onMetadataChanged(MediaMetadata metadata)

覆盖以处理对当前元数据的更改。

void onPlaybackStateChanged(PlaybackState state)

覆盖以处理播放状态的变化。

void onQueueChanged(List<MediaSession.QueueItem> queue)

重写以处理对队列中项目的更改。

void onQueueTitleChanged(CharSequence title)

重写以处理对队列标题的更改。

void onSessionDestroyed()

重写以处理被销毁的会话。

void onSessionEvent(String event, Bundle extras)

重写以处理由会话所有者发送的没有指定接口的自定义事件。

Inherited methods

From class java.lang.Object

Public constructors

MediaController.Callback

Added in API level 21
MediaController.Callback ()

Public methods

onAudioInfoChanged

Added in API level 21
void onAudioInfoChanged (MediaController.PlaybackInfo info)

覆盖以处理对音频信息的更改。

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

onExtrasChanged

Added in API level 21
void onExtrasChanged (Bundle extras)

重写以处理对 MediaSession演员的更改。

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

onMetadataChanged

Added in API level 21
void onMetadataChanged (MediaMetadata metadata)

覆盖以处理对当前元数据的更改。

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

也可以看看:

onPlaybackStateChanged

Added in API level 21
void onPlaybackStateChanged (PlaybackState state)

覆盖以处理播放状态的变化。

Parameters
state PlaybackState: The new playback state of the session

onQueueChanged

Added in API level 21
void onQueueChanged (List<MediaSession.QueueItem> 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 API level 21
void onQueueTitleChanged (CharSequence 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.

onSessionDestroyed

Added in API level 21
void onSessionDestroyed ()

重写以处理被销毁的会话。 此通话结束后,该会话不再有效,并且将忽略该通话。

onSessionEvent

Added in API level 21
void onSessionEvent (String event, 
                Bundle extras)

重写以处理由会话所有者发送的没有指定接口的自定义事件。 控制器只能处理它们拥有的会话。

Parameters
event String: The event from the session.
extras Bundle: Optional parameters for the event, may be null.

Hooray!