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
Provide a way to make fastforward/rewind buttons visible in compact notification mode #7733
Comments
@marcbaechinger Please could you take a look? Thanks. |
So for locked screen i need Rewind, Play/Pause, FastForward |
To hide the navigation button it is sufficient to The seekbar is displayed by the system automatically when the duration of the media is set in the playback state of the notification. The I'm not sure what the reason is to subclass the I recommend doing this with the If you see different results on the lock screen, it can be that the device vendor changed the behaviour on the lock screen. It would be important to know what device you are using and a screen shot from the lockscreen would be helpful as well. Let me know whether that hepls. |
I am using Mi A3 Android 10. The difference I am getting is that rewind and fast forward options are not coming by default on locked screen that's the reason I wanted to customize it for compact view actions. Now not using custom actions for compact and have set But on a locked screen, I just get the Play/Pause actions button whereas I need it with rewind and fast forward actions. |
I'm not sure how the vendor creates the controls on the lock screen. I guess they are doing something differently than normal Android. Vendors can change the lock screen to behave differently. My guess is that they either just generally allow the play/pause button only. If that is true, then all other audio apps like YouTube Music or Spotify would also only have the play/pause button? Do you see other controls for other audio apps on that device? If other audio apps have more controls, the vendor probably builds the UI on the lock screen along the action exposed by the media session. I suspect you are using a media session, because normally a media session is required to make the controls on the lock screen appear. Can you run
on you device when your app is up and running and paste the output here? |
This comment has been minimized.
This comment has been minimized.
Yes i could see the control for other apps, the similar behaviour I need So my player should have following controls - Mentioning below the Output of requested command -
|
Thanks! I assume the app with the package name you obfuscated is your app.
These two session declare that different actions are supported for each of the session:
The first session has the bitmask Can you please make sure that your app:
If you do this and then run |
Now after the same sequence as you told , here is the output - but still on locked screen i just see play/pause action alone
|
It seems to me that there are now 4 sessions from your app. Can you confirm? If so it is worth to bring the app in a state that it only exposes one single media session. This way we can rule out problems of the system using another session than we expect. Can you please send me a screenshot of both, the notification in the notification drawer and the notification on the lock screen? To clarify what can be expected: By calling
the previous/next buttons are hidden in expanded and compact mode. Calling
does not change this, as the java doc of
On the lock screen you probably see the compact mode that shows only the play/pause button when navigation buttons are disabled. If you expand the notification of the lock screen all three buttons plus the seek bar become visible and can be used by the user from the lock screen without unlocking the device. Please note that, the |
https://ibb.co/SrQ2Rp3 |
Ok, that's fine then. If you expand the notification on the lock screen you will have the rewind/fastforward buttons and the seekbar. That's what the |
@marcbaechinger hi , is there any way to do that? Because I have the same requirement. I need fast forward and rewind buttons in compact notification. |
The You can subclass the |
@marcbaechinger I did so now it works. However expandable mode is now absent (down arrow disapeared) |
@marcbaechinger, to be precise. My aim is that there would be rewind and fast-forward buttons in compact mode and expandable mode available. |
If you only override the method [1] actions in expanded view mode: return value of |
I have implemented CustomPlayerNotificationManager and have overridden the actions for locked screen and to show CustomPlayerNotificationManager I have to enable setUseNavigationActions(true) which is showing the previous button in expanded player notification and if I am setting it false notification not visible. Please help locked screen working fine but want to hide 'Previous' icon in expanded view
The text was updated successfully, but these errors were encountered: