google / google/ExoPlayer

How to keep the same order of custom media actions

Open
#11,027 14 comments 0 reactions 1 assignee Claimed by @marcbaechinger View on GitHub
question
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

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
```
MediaSessionConnector(mediaSession).setCustomActionProviders(object :
MediaSessionConnector.CustomActionProvider {
override fun onCustomAction(player: Player, action: String, extras: Bundle?) {}

override fun getCustomAction(player: Player): PlaybackStateCompat.CustomAction? {
return PlaybackStateCompat.CustomAction.Builder(
"SKIP_TO_PREVIOUS_ACTION",
"previous",
if (!isFirst)
R.drawable.ic_previous_with_padding
else R.drawable.ic_previous_disabled_with_padding
).build()
}
},
object : MediaSessionConnector.CustomActionProvider {
override fun onCustomAction(player: Player, action: String, extras: Bundle?) {}

override fun getCustomAction(player: Player): PlaybackStateCompat.CustomAction? {
return PlaybackStateCompat.CustomAction.Builder(
"SKIP_TO_NEXT_ACTION",
"next",
if (!isLast)
R.drawable.ic_next_with_padding
else R.drawable.ic_next_disabled_with_padding
).build()
}
}

```
![1](https://user-images.githubusercontent.com/126549215/221774016-d56321a2-bafb-4127-b265-61eaf8f8b3f3.png)
![2](https://user-images.githubusercontent.com/126549215/221774025-93604e03-d082-4a0b-a6bf-7711801359bf.png)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.