Open pawaom opened 4 years ago
I'd like to make sure I've understood exactly what behaviour you're expecting and what you're seeing, both with and without your code changes.
Let's assume we've got a playlist with 3 items:
My understanding of your expectations:
REPEAT_MODE_OFF
or REPEAT_MODE_ONE
and playing Song C.
REPEAT_MODE_OFF
or REPEAT_MODE_ONE
and playing Song A.
And what you're actually seeing with 'stock' ExoPlayer:
REPEAT_MODE_OFF
or REPEAT_MODE_ONE
and playing Song C.
REPEAT_MODE_OFF
& near start of Song C) or restart Song C (REPEAT_MODE_ONE
or in middle of Song C (regardless of repeat mode)).REPEAT_MODE_OFF
or REPEAT_MODE_ONE
and playing Song A.
AFAICT from your screenshots your code changes haven't had any effect on this behaviour - is that right?
Marc can help you with customising the behaviour & visibility of these buttons.
You got the scenario mostly right, using your own example I would explain
Songs A, B, C
Player is in REPEAT_MODE_OFF
or REPEAT_MODE_ONE
scenario 1
currently we are playing Song C
When we click previous button it should go to the previous song,ie song B, instead sometime it repeats the same song which I have explained here
and the next button is invisible
what I want is to show the next button and allow user to go to Song A, when this button is clicked
scenario 2
currently we are playing Song A
Player is in REPEAT_MODE_OFF
or REPEAT_MODE_ONE
When we click previous button it should go to the previous song,ie song C, instead it Always repeats the same song
I understand this might be the expected behavior as per the developers, but what i want is allow us as developers the flexibility to play the songs in an order we would like
I think the behaviour you are describing works as expected. I agree that the current implementation can be seen as opinionated, but that's probably the case for however we implement it :). I agree that your approach makes sense as well for some users. I'm hesitating a bit to change the default behaviour from one opinionated variant to another after having the current implementation in place since quite a while with no input on not being useful.
However, I totally agree, we should provide ways so you can implement your custom behaviour. I think this should already be possible with dev-v2, so please let me know whether this is the case.
Like already mentioned in the other issue you filed, customization of previous/next is available only in the dev-v2 branch or in the future, when the change has landed in release-v2.
Scenario 1
You need to override PlayerNotificationManager.getActions()
and return ACTION_NEXT even when at the end of the playlist. Currently ACTION_NEXT
is only included when there is a next item, which is not the case when repeating is off. In addition you need to provide your custom ControlDispatcher
and pass it to PlayerNotificationManager.setControlDispatcher()
. You need to override dispatchNext(Player player)
accordingly.
Scenario 2
You need to provide your custom ControlDispatcher
and pass it to PlayerNotificationManager.setControlDispatcher()
. You need to override dispatchPrevious(Player player)
accordingly.
Please let me know whether this helps.
I agree the default behaviour, is one approach, What we suggested was based on feedback we got from testing with a select group of users. to summarize their opinion, it was 1) users expect a button to be active (in all cases not disable) 2) if a button was visible earlier it should be visible always (making it invisible makes it difficult to follow the user experience flow )
example
looks totally different in this situation
all we wanted was an option to access the next button so that we could use
if (player.hasNext()) {
player.next();
} else {
player.seekTo(0, C.TIME_UNSET);
}
if an option called playerNotificationManager.setnextbutton(true);
similar to
```
playerNotificationManager.setUseChronometer(false);
playerNotificationManager.setUsePlayPauseActions(true);
playerNotificationManager.setUseStopAction(true);
```
was available and we could access it , to pass the above code, would have made things a lot easier,
I understand your approach to override PlayerNotificationManager.getActions()
or use custom ControlDispatcher
but it would be easier if a simpler method was available
thanks,
thanks for including this as an enhancement , please include this feature in the mediasessions part as well, (lock screen controls) as shown in the screenshot I have shared above @marcbaechinger
recently I cam across this
https://github.com/google/ExoPlayer/pull/7437
@marcbaechinger I just want to know , if this enhancement be included in this release
thanks
We don't have any progress on this I'm afraid.
Force to show next and previous button for first and last song in notification and Lock screen controls when player.setRepeatMode(Player.REPEAT_MODE_ONE); and player.setRepeatMode(Player.REPEAT_MODE_OFF);
The normal behavior of a music player is 1) when player.setRepeatMode(Player.REPEAT_MODE_ONE); and player.setRepeatMode(Player.REPEAT_MODE_OFF); to show previous and next button to allow users to go back to the first or last song when they desire to, when either the first or last song is played
what actually happens in exoplayer notification and lock screen control 1) when user is on Last song with REPEAT_MODE_ONE or REPEAT_MODE_OFF , the next button is invisible, not allowing user to click the next button to go to the "FIRST" song 2) when user is on Last song with REPEAT_MODE_ONE or REPEAT_MODE_OFF ,the previous button is visible,but nothing happens, not allowing user to click the previous button to go to the "LAST" song
I am trying to override this WRONG process
using this code
But nothing works , can any one suggest what should I do
What I am getting is
What I want is
for both Notification and Lock Screen Controls