Recommended way to resume media playback from the app with PlayerView/PlayerControlView
@marcbaechinger is already working on this.
Since Nov 8, 2023.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Devices that reproduce the issue
Tested on Emulator with API 34 (should be the same with lower API)
Reproducible in the demo app?
Yes
Reproduction steps:
- Open the
demo-sessionapp and play a media item. - Pause playback and put the app in background.
- Wait a few minutes until the player controls notification is removed.
- Open the app again.
Result:
The PlayerView (PlayerControlView with an audio player app) is blank - play/skip controls are disabled, and playback cannot be resumed from these controls.
Resumption is possible by adding MediaButtonReceiver and implementing Callback.onPlaybackResumption(), but from a user's perspective it's only possible with a BT headset or the resumption notification.
Question:
Is there a recommended way how this should be handled in the app? Is there a way to use playback resumption to resume playback from the app when it is in foreground? The playlist restoration logic we add in Callback.onPlaybackResumption() seems to be the same logic one would use to restore the playlist on their own when the app is restarted, or in this case even onResume()'d.
I found out that calling mediaController.play() does execute media resumption, but I can't really call play() every time the app is resumed, as that would not be expected behaviour.
This issue may be related to #27
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.