You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then in addNotificationActions of CustomMediaNotificationProvider, I set:
val defaultPlayPauseButton = mediaButtons.getOrNull(1)
val defaultRestartButton = mediaButtons.getOrNull(0)
val notificationMediaButtons = if (defaultPlayPauseButton != null) {
/* Overriding received mediaButtons list to ensure required buttons order: [rewind15, play/pause, forward15]. */
ImmutableList.builder<CommandButton>().apply {
if (defaultRestartButton != null) add(defaultRestartButton)
add(NotificationCustomButton.REWIND.commandButton)
add(defaultPlayPauseButton)
add(NotificationCustomButton.FORWARD.commandButton)
add(NotificationCustomButton.SKIP.commandButton)
}.build()
} else {
/* Fallback option to handle nullability, in case retrieving default play/pause button fails for some reason (should never happen). */
mediaButtons
}
For more detail, check my open-sourced project : Podcini
Expected result
I expect the order to correspond to that in addNotificationActions of CustomMediaNotificationProvider (restart, rewind, play/pause, forward, skip), and/or in the layout enum. It turns out it has a lot to do with the enum but in a strange way. I had to fool around the enum order to get to desired order on screen, so the current is: skip, rewind, forward.
Actual result
what show up on Android 9 is: restart, rewind, play/pause, forward, skip,
and on Android 14: rewind, restart, play/pause, skip, forward.
restart and play/pause are from media3. btw, I don't get skip by default from media3.
Version
Media3 1.3.1
More version details
No response
Devices that reproduce the issue
Android 9, 14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
I configured my custom action button in an enum:
Then when building the media session, I set the layout:
Then in addNotificationActions of CustomMediaNotificationProvider, I set:
For more detail, check my open-sourced project : Podcini
Expected result
I expect the order to correspond to that in addNotificationActions of CustomMediaNotificationProvider (restart, rewind, play/pause, forward, skip), and/or in the layout enum. It turns out it has a lot to do with the enum but in a strange way. I had to fool around the enum order to get to desired order on screen, so the current is: skip, rewind, forward.
Actual result
what show up on Android 9 is: restart, rewind, play/pause, forward, skip,
and on Android 14: rewind, restart, play/pause, skip, forward.
restart and play/pause are from media3. btw, I don't get skip by default from media3.
Media
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: