Stay organized with collections
Save and categorize content based on your preferences.
RemoteController.OnClientUpdateListener
public
static
interface
RemoteController.OnClientUpdateListener
android.media.RemoteController.OnClientUpdateListener
|
Interface definition for the callbacks to be invoked whenever media events, metadata
and playback status are available.
Summary
Public methods |
abstract
void
|
onClientChange(boolean clearing)
Called whenever all information, previously received through the other
methods of the listener, is no longer valid and is about to be refreshed.
|
abstract
void
|
onClientMetadataUpdate(RemoteController.MetadataEditor metadataEditor)
Called whenever new metadata is available.
|
abstract
void
|
onClientPlaybackStateUpdate(int state, long stateChangeTimeMs, long currentPosMs, float speed)
Called whenever the playback state has changed, and playback position
and speed are known.
|
abstract
void
|
onClientPlaybackStateUpdate(int state)
Called whenever the playback state has changed.
|
abstract
void
|
onClientTransportControlUpdate(int transportControlFlags)
Called whenever the transport control flags have changed.
|
Public methods
onClientChange
public abstract void onClientChange (boolean clearing)
Called whenever all information, previously received through the other
methods of the listener, is no longer valid and is about to be refreshed.
This is typically called whenever a new RemoteControlClient
has been selected
by the system to have its media information published.
Parameters |
clearing |
boolean : true if there is no selected RemoteControlClient and no information
is available. |
onClientPlaybackStateUpdate
public abstract void onClientPlaybackStateUpdate (int state,
long stateChangeTimeMs,
long currentPosMs,
float speed)
Called whenever the playback state has changed, and playback position
and speed are known.
Parameters |
state |
int : one of the playback states authorized
in RemoteControlClient.setPlaybackState(int) . |
stateChangeTimeMs |
long : the system time at which the state change was reported,
expressed in ms. Based on SystemClock.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 RemoteControlClient.PLAYSTATE_ERROR ). |
onClientPlaybackStateUpdate
public abstract void onClientPlaybackStateUpdate (int state)
Called whenever the playback state has changed.
It is called when no information is known about the playback progress in the media and
the playback speed.
onClientTransportControlUpdate
public abstract void onClientTransportControlUpdate (int transportControlFlags)
Called whenever the transport control flags have changed.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# RemoteController.OnClientUpdateListener\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nRemoteController.OnClientUpdateListener\n=======================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/RemoteController.OnClientUpdateListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nRemoteController.OnClientUpdateListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------|\n| android.media.RemoteController.OnClientUpdateListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for the callbacks to be invoked whenever media events, metadata\nand playback status are available.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onClientChange](/reference/android/media/RemoteController.OnClientUpdateListener#onClientChange(boolean))`(boolean clearing) ` Called whenever all information, previously received through the other methods of the listener, is no longer valid and is about to be refreshed. |\n| ` abstract void` | ` `[onClientMetadataUpdate](/reference/android/media/RemoteController.OnClientUpdateListener#onClientMetadataUpdate(android.media.RemoteController.MetadataEditor))`(`[RemoteController.MetadataEditor](/reference/android/media/RemoteController.MetadataEditor)` metadataEditor) ` Called whenever new metadata is available. |\n| ` abstract void` | ` `[onClientPlaybackStateUpdate](/reference/android/media/RemoteController.OnClientUpdateListener#onClientPlaybackStateUpdate(int,%20long,%20long,%20float))`(int state, long stateChangeTimeMs, long currentPosMs, float speed) ` Called whenever the playback state has changed, and playback position and speed are known. |\n| ` abstract void` | ` `[onClientPlaybackStateUpdate](/reference/android/media/RemoteController.OnClientUpdateListener#onClientPlaybackStateUpdate(int))`(int state) ` Called whenever the playback state has changed. |\n| ` abstract void` | ` `[onClientTransportControlUpdate](/reference/android/media/RemoteController.OnClientUpdateListener#onClientTransportControlUpdate(int))`(int transportControlFlags) ` Called whenever the transport control flags have changed. |\n\nPublic methods\n--------------\n\n### onClientChange\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClientChange (boolean clearing)\n```\n\nCalled whenever all information, previously received through the other\nmethods of the listener, is no longer valid and is about to be refreshed.\nThis is typically called whenever a new [RemoteControlClient](/reference/android/media/RemoteControlClient) has been selected\nby the system to have its media information published.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|-----------------------------------------------------------------------------------------------------|\n| `clearing` | `boolean`: true if there is no selected RemoteControlClient and no information is available. \u003cbr /\u003e |\n\n### onClientMetadataUpdate\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClientMetadataUpdate (RemoteController.MetadataEditor metadataEditor)\n```\n\nCalled whenever new metadata is available.\nSee the [MediaMetadataEditor.putLong(int, long)](/reference/android/media/MediaMetadataEditor#putLong(int,%20long)),\n[MediaMetadataEditor.putString(int, String)](/reference/android/media/MediaMetadataEditor#putString(int,%20java.lang.String)),\n[MediaMetadataEditor.putBitmap(int, Bitmap)](/reference/android/media/MediaMetadataEditor#putBitmap(int,%20android.graphics.Bitmap)), and\n[MediaMetadataEditor.putObject(int, Object)](/reference/android/media/MediaMetadataEditor#putObject(int,%20java.lang.Object)) methods for the various keys that\ncan be queried.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------------|------------------------------------------------------------------------------|\n| `metadataEditor` | `RemoteController.MetadataEditor`: the container of the new metadata. \u003cbr /\u003e |\n\n### onClientPlaybackStateUpdate\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClientPlaybackStateUpdate (int state, \n long stateChangeTimeMs, \n long currentPosMs, \n float speed)\n```\n\nCalled whenever the playback state has changed, and playback position\nand speed are known.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `state` | `int`: one of the playback states authorized in [RemoteControlClient.setPlaybackState(int)](/reference/android/media/RemoteControlClient#setPlaybackState(int)). \u003cbr /\u003e |\n| `stateChangeTimeMs` | `long`: the system time at which the state change was reported, expressed in ms. Based on [SystemClock.elapsedRealtime()](/reference/android/os/SystemClock#elapsedRealtime()). \u003cbr /\u003e |\n| `currentPosMs` | `long`: a positive value for the current media playback position expressed in ms, a negative value if the position is temporarily unknown. \u003cbr /\u003e |\n| `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 [RemoteControlClient.PLAYSTATE_ERROR](/reference/android/media/RemoteControlClient#PLAYSTATE_ERROR)). \u003cbr /\u003e |\n\n### onClientPlaybackStateUpdate\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClientPlaybackStateUpdate (int state)\n```\n\nCalled whenever the playback state has changed.\nIt is called when no information is known about the playback progress in the media and\nthe playback speed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `state` | `int`: one of the playback states authorized in [RemoteControlClient.setPlaybackState(int)](/reference/android/media/RemoteControlClient#setPlaybackState(int)). \u003cbr /\u003e |\n\n### onClientTransportControlUpdate\n\nAdded in [API level 19](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onClientTransportControlUpdate (int transportControlFlags)\n```\n\nCalled whenever the transport control flags have changed.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `transportControlFlags` | `int`: one of the flags authorized in [RemoteControlClient.setTransportControlFlags(int)](/reference/android/media/RemoteControlClient#setTransportControlFlags(int)). \u003cbr /\u003e |"]]