Open ziem opened 2 months ago
Media3 release branch
1.3.1
Samsung Z Fold 4 (Android 14)
No response
Yes
so far everything is correct, media starts to play from the correct position (playlist index is also correct)
media starts to play from the beginning which is incorrect
Switching between local and cast players should correctly restore the current index and position.
Currently, it works fine when switching from local player to cast player, but the position is reset when switching from cast player to local player.
I'm not sure why, but when the cast is disconnected, CastPlayer loses the current media index. getCurrentMediaItemIndex() starts to return 0.
CastPlayer
getCurrentMediaItemIndex()
I saw some kind of index checking in the demo app https://github.com/androidx/media/blob/release/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java#L285-L299, but this workaround seems to be not good enough. I can observe the same behavior in my codebase.
HLS (adaptive): Apple 4x3 basic stream HLS (adaptive): Apple 16x9 basic HLS (1280x720): Designing For Google Cast
adb bugreport
Thanks for reporting. I'll mark it as a bug, but we are not likely to get around to look into soon. If you see an easy fix to solve it and want to send a PR, feel free to do so.
Version
Media3 release branch
More version details
1.3.1
Devices that reproduce the issue
Samsung Z Fold 4 (Android 14)
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
so far everything is correct, media starts to play from the correct position (playlist index is also correct)
media starts to play from the beginning which is incorrect
Expected result
Switching between local and cast players should correctly restore the current index and position.
Actual result
Currently, it works fine when switching from local player to cast player, but the position is reset when switching from cast player to local player.
I'm not sure why, but when the cast is disconnected,
CastPlayer
loses the current media index.getCurrentMediaItemIndex()
starts to return 0.I saw some kind of index checking in the demo app https://github.com/androidx/media/blob/release/demos/cast/src/main/java/androidx/media3/demo/cast/PlayerManager.java#L285-L299, but this workaround seems to be not good enough. I can observe the same behavior in my codebase.
Media
HLS (adaptive): Apple 4x3 basic stream HLS (adaptive): Apple 16x9 basic HLS (1280x720): Designing For Google Cast
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.