-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playback resumption - How to opt-out at runtime? #770
Comments
Thanks for the detailed report and the text fixture. The notification in the screenshot is not posted by Media3. This is the playback resumption notification posted by system UI (see for instance the ExoPlayer logo as the app icon at the top left, the demo app uses a different icon). After calling When we do a
Idle is mapped to In this situation system UI posts the playback resumption notification and Media3 expects the app to have
I think this is working as intended. Can you let me know, what you are trying to achieve? |
Thank you for your answer Marc,
Good point, I didn't realize it at the time.
I didn't know that also in this situation the system will display a playback resumption notification. As I described above, we have
Audio player is just one of the functionalities in our application. What I'm trying to achieve is when the user really stops playing (not just pauses) or if the user logout. Right now in these situations I'm calling So how should I behave in these situations if I don't want to display the playback resumption notification (moreover in these situations I have nothing to "resume" in onPlaybackResumption)? |
Thanks for clarification. Very helpful. Your use cases isn't well supported by Media3 yet. You can't opt-in and opt-out programmatically. There is only the way of declaring the receiver in the manifest. With this playback resumption is activated. Looks like a valid use case though, so I think we should aim to provide a bit more fine-grained support for opting-in and out. Technically, Media3 could enable/disable resumption for media button event at runtim. So we could do something like long story short - looks like we should think about a way to separate media button resumption and the System UI notification. You could then at least choose to only support BT resumption which we then can make changeable at runtime. I have marked this issue as an enhancement:
|
Thank you very much Marc, very nice summary, I will look forward to it 🚀 👀 |
Version
Media3 1.1.1
More version details
No response
Devices that reproduce the issue
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
Dead silent notification should not be displayed (as it behaves when no MediaButtonReceiver is declared).
I know, I can handle the play event from the dead silent notification in the onPlaybackResumption() method (and that's how I do it too), but if I understand it correctly, this notification shouldn't show at all after calling stop() method on MediaController or not? (as it behaves when no MediaButtonReceiver is declared)
Actual result
A dead silent notification will appear.
Media
My fork - https://github.com/TomasValenta/media
Dead silent notification
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: