-
Notifications
You must be signed in to change notification settings - Fork 6k
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
How to keep the same order of custom media actions #11027
Comments
This may be because these devices have different operating system versions. When you do this with a From the screenshot and the info above, it looks like this is a notification on a device before Android 13. I may be wrong, but if this is the case, then the custom actions in the session have no impact on the action on the notification. This includes that you keep the |
@marcbaechinger I have already read the documentation for Android 13 updates. As per documentaion i have integrating the custom buttons through I did not find any way to resolve this. Could you please explain how we ensure that this behaves consistently across all API levels?I did not find anything in the documentation regarding this issue. |
I don't think I have more info than what is documented in the Android 13 changes that you already know: https://developer.android.com/about/versions/13/behavior-changes-13#playback-controls These are the guideline with which we implemented the custom commands of the Media3 session module to support notifications on all API levels (see androidx/media#38). I will test the Media3 implementation with a Samsung phone with Android 13 as soon as I get my hands on such a device. From your code you posted this looks like what I would expect is required to do and as you say, it seems to work on some devices. So we can rule out that the According to the doc linked above, it should work if the actions are in the correct order in the legacy/platform session. You can verify this by looking at what
outputs for your session. |
Yeah, you are right that Samsung is doing their own thing on Android 13. Accordingly, what I know is about the same as you. The notification is apparently based on the media session as the custom action is replicated in the notification. However, the layout and the placing of buttons as for rewind/ffwd and custom actions is different from what vanilla Android does. This is Galaxy S21 with Android 13 And this is what system UI of Android does without modification of the OEM: You can imagine that I am as happy about this as you are. :( This is obviously different and I do not have information about how Samsung draws the notification. |
@marcbaechinger I'm facing the same problem and we made a dirty workaround for samsung devices that inverts the list of custom actions and looks woking but with some exceptions: if there is a single element o if there is a playlist (see attached video without implementing the fix). It's so weird to see how the drawing mechanism is so inconsistent that even trying to implement a fix doesn't work... As per the documentation I see that we can set them empty by: PlaybackState extras include a true boolean value for key SESSION_EXTRAS_KEY_SLOT_RESERVATION_SKIP_TO_PREV. But I'm not sure how to do that with exoplayer, should be do it though Thank you! Look in the video how when there is no "next" icon, the ff/rw icons are reversed but when both next/previous are present they look normal. Screen_Recording_20230309_123026_Waking.Up.Debug.mp4 |
Many thanks for this. Very useful!
Can you let me know how you produced the notification from above video? When you use I have some question to your screencast: Is this done with Media3? If not, are the custom actions in the media session or are the buttons in the notification the notification actions that you've put into the
I try to find out something. |
@marcbaechinger I'm preparing a project with something similar of my implementation so you can take a look on it :) will try to do in the next few days. |
(Internal bug-ref sent to Samsung: b/273221499) |
Any update on the same from samsung? Can you share the bug report link if available? |
Unfortunately no response yet. Can you still repro this with the most recent Media3 version? If you can upload a screenshot and shortly describe this would be helpful. I can nudge again and see whether they give me a response. Until now I have no feedback unfortunately. My situation is not much better than yours to be honest. You may, as an alternative, find ways to file a bug directly on a Samsung site. |
@marcbaechinger Yes, I have the same or similar issue on Samsung devices running Android 13 and 14. I just want to add the Seek back and Seek forward buttons as you mentioned here and on the OEM Android 13 it works as I would expect according to the documentation: OEM Android (OEM Android 13 - Playlist with action skip to next active) (OEM Android 13 - Playlist with action skip to next inactive (last item or single item playlist)) Samsung (Samsung Android 13,14 - Playlist with action skip to next active, not bad) BUT (Samsung Android 13,14 - Playlist with action skip to next inactive (last item or single item playlist)) Seek back and Seek forward buttons are swapped and compact mode looks weird :/ I tried to customize positions in the Still no response from Samsung? |
That's a long shot as this is more for SystemUi than for Auto. Have you tried reserving the seek to next button ('EXTRAS_KEY_SLOT_RESERVATION_SEEK_TO_NEXT')?
|
I want to use custom next/previous actions instead of the native ones. So I started by removing the native ones by allowing only needed actions: But in some devices
As you observed, the buttons in the home section are inverted, how can I keep the same order as in the app? But in some devices its working fine
Any idea how we can resolve this?
@phhusson @xian @canatella @kiall @talklittle @marcbaechinger
The text was updated successfully, but these errors were encountered: