Most visited

Recently visited

Added in API level 19

RemoteController.OnClientUpdateListener

public static interface RemoteController.OnClientUpdateListener

android.media.RemoteController.OnClientUpdateListener


只要媒体事件,元数据和播放状态可用,就会调用回调的接口定义。

Summary

Public methods

abstract void onClientChange(boolean clearing)

只要以前通过侦听器的其他方法接收到的所有信息不再有效并且即将刷新,就会被调用。

abstract void onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor)

每当有新的元数据可用时调用。

abstract void onClientPlaybackStateUpdate(int state, long stateChangeTimeMs, long currentPosMs, float speed)

每当播放状态改变时播放,并且播放位置和播放速度已知。

abstract void onClientPlaybackStateUpdate(int state)

播放状态改变时调用。

abstract void onClientTransportControlUpdate(int transportControlFlags)

每当传输控制标志发生变化时调用。

Public methods

onClientChange

Added in API level 19
void onClientChange (boolean clearing)

只要以前通过侦听器的其他方法接收到的所有信息不再有效并且即将刷新,就会被调用。 这通常在系统选择新的RemoteControlClient来发布其媒体信息时被调用。

Parameters
clearing boolean: true if there is no selected RemoteControlClient and no information is available.

onClientMetadataUpdate

Added in API level 19
void onClientMetadataUpdate (RemoteController.MetadataEditor metadataEditor)

每当有新的元数据可用时调用。 putLong(int, long)putString(int, String)putBitmap(int, Bitmap) ,并putObject(int, Object)方法可以查询各个键。

Parameters
metadataEditor RemoteController.MetadataEditor: the container of the new metadata.

onClientPlaybackStateUpdate

Added in API level 19
void onClientPlaybackStateUpdate (int state, 
                long stateChangeTimeMs, 
                long currentPosMs, 
                float speed)

每当播放状态改变时播放,并且播放位置和播放速度已知。

Parameters
state int: one of the playback states authorized in setPlaybackState(int).
stateChangeTimeMs long: the system time at which the state change was reported, expressed in ms. Based on elapsedRealtime().
currentPosMs long: a positive value for the current media playback position expressed in ms, a negative value if the position is temporarily unknown.
speed float: a value expressed as a ratio of 1x playback: 1.0f is normal playback, 2.0f is 2x, 0.5f is half-speed, -2.0f is rewind at 2x speed. 0.0f means nothing is playing (e.g. when state is PLAYSTATE_ERROR).

onClientPlaybackStateUpdate

Added in API level 19
void onClientPlaybackStateUpdate (int state)

播放状态改变时调用。 当没有关于媒体播放进度和播放速度的信息时调用它。

Parameters
state int: one of the playback states authorized in setPlaybackState(int).

onClientTransportControlUpdate

Added in API level 19
void onClientTransportControlUpdate (int transportControlFlags)

每当传输控制标志发生变化时调用。

Parameters
transportControlFlags int: one of the flags authorized in setTransportControlFlags(int).

Hooray!