abstractfun onPlaybackPositionUpdate(newPositionMs:Long): Unit
Deprecated: Deprecated in Java.
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 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnPlaybackPositionUpdateListener\n================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/RemoteControlClient.OnPlaybackPositionUpdateListener \"View this page in Java\") \n\n```\ninterface OnPlaybackPositionUpdateListener\n```\n\n|-------------------------------------------------------------------------|\n| [android.media.RemoteControlClient.OnPlaybackPositionUpdateListener](#) |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 29.**\n|\n| Deprecated in Java.\n\nInterface definition for a callback to be invoked when the media playback position is requested to be updated.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onPlaybackPositionUpdate](#onPlaybackPositionUpdate(kotlin.Long))`(`newPositionMs:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onPlaybackPositionUpdate(newPositionMs: Long): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCalled 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 [setPlaybackState(int,long,float)](/reference/kotlin/android/media/RemoteControlClient#setPlaybackState(kotlin.Int,%20kotlin.Long,%20kotlin.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.\n\n| Parameters ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| `newPositionMs` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): the new requested position in the current media, expressed in ms. |"]]