Stay organized with collections
Save and categorize content based on your preferences.
RemoteControlClient.OnPlaybackPositionUpdateListener
public
static
interface
RemoteControlClient.OnPlaybackPositionUpdateListener
android.media.RemoteControlClient.OnPlaybackPositionUpdateListener
|
Interface definition for a callback to be invoked when the media playback position is
requested to be updated.
Summary
Public methods |
abstract
void
|
onPlaybackPositionUpdate(long newPositionMs)
Called on the implementer to notify it that the playback head should be set at the given
position.
|
Public methods
onPlaybackPositionUpdate
public abstract void onPlaybackPositionUpdate (long newPositionMs)
Called on the implementer to notify it that the playback head should be set at the given
position. If the position can be changed from its current value, the implementor of
the interface must also update the playback position using
RemoteControlClient.setPlaybackState(int, long, float)
to reflect the actual new
position being used, regardless of whether it differs from the requested position.
Failure to do so would cause the system to not know the new actual playback position,
and user interface components would fail to show the user where playback resumed after
the position was updated.
Parameters |
newPositionMs |
long : the new requested position in the current media, expressed in ms. |
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,["# RemoteControlClient.OnPlaybackPositionUpdateListener\n\nAdded in [API level 18](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nRemoteControlClient.OnPlaybackPositionUpdateListener\n====================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/RemoteControlClient.OnPlaybackPositionUpdateListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nRemoteControlClient.OnPlaybackPositionUpdateListener\n`\n\n\n`\n\n\n`\n\n|--------------------------------------------------------------------|\n| android.media.RemoteControlClient.OnPlaybackPositionUpdateListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nInterface definition for a callback to be invoked when the media playback position is\nrequested to be updated. \n**See also:**\n\n- [RemoteControlClient.FLAG_KEY_MEDIA_POSITION_UPDATE](/reference/android/media/RemoteControlClient#FLAG_KEY_MEDIA_POSITION_UPDATE)\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onPlaybackPositionUpdate](/reference/android/media/RemoteControlClient.OnPlaybackPositionUpdateListener#onPlaybackPositionUpdate(long))`(long newPositionMs) ` Called on the implementer to notify it that the playback head should be set at the given position. |\n\nPublic methods\n--------------\n\n### onPlaybackPositionUpdate\n\nAdded in [API level 18](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onPlaybackPositionUpdate (long newPositionMs)\n```\n\nCalled on the implementer to notify it that the playback head should be set at the given\nposition. If the position can be changed from its current value, the implementor of\nthe interface must also update the playback position using\n[RemoteControlClient.setPlaybackState(int, long, float)](/reference/android/media/RemoteControlClient#setPlaybackState(int,%20long,%20float)) to reflect the actual new\nposition being used, regardless of whether it differs from the requested position.\nFailure to do so would cause the system to not know the new actual playback position,\nand user interface components would fail to show the user where playback resumed after\nthe position was updated.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------------|----------------------------------------------------------------------------------|\n| `newPositionMs` | `long`: the new requested position in the current media, expressed in ms. \u003cbr /\u003e |"]]