Strange behavior on pause & resume
Media3 Version
1.0.0-beta01
Devices that reproduce the issue
Wear OS emulator -- Android 11.0 Wear OS 3 - Preview | arm64 Samsung Galaxy Watch4 (Android 11 Wear OS 3.2)
Devices that do not reproduce the issue
N/A
Reproducible in the demo app?
Not tested
Reproduction steps
When playing, pausing and resuming an AAC ADTS file, there are strange jumps in the play position during each transition.
-
When starting playback, the current position briefly jumps ahead before coming back. For example: STATE_READY, position = 0 Event EVENT_IS_PLAYING_CHANGED, Current position is 933 Current position is 11 Current position is 53 Current position is 87 ...
-
When pausing, the current position jumps backwards: Current position is 2330 Current position is 2364 Current position is 2397 IS_PLAYING changed, updating state; position = 1247
-
When resuming, the current position jumps forwards, beyond where it was before jumping backwards in 2): Current position is 4474 Current position is 4508 ...
These AAC ADTS files are produced by the same app that is playing them.
Expected result
I would like the playback position to stay where it was so the recording can pause & resume from the same place. Jumping around leads to a poor user experience.
Actual result
The playback position is jumping around. Media and bug report will be emailed.
Media
Media will be emailed along with the bug report.
Bug Report
- [X] You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
I have the same issue on a nexus 10 and samsung galaxie 7. After you trigger the pause, if you wait a little bit and get the position again, it's back to the right position. If you take the position from the MediaController on a timer, it would be something like this ... playing music ... position 4000 position 4050 Pause position 2357 position 2357 position 4067 position 4067
If you can have access to the exoplayer, like in the service. When you query the position from it, the value looks right. There is a difference between ExoPlayer and MediaController currentPosition when changing state. In the mediaController it's 2357 but 4067 in the player.
@Digipom we are seeing this also. In your example are you using MediaController and ExoPlayer together?
Yes! Indeed I am.
This should be fixed with commit https://github.com/androidx/media/commit/9336b95bf4355c4b1e43f95879d9af45cf90cd19 which is included in the beta03 release.
I'll close this issue, please re-open if the problem remains on your app.
Thanks.