Android 13 Media3 Notification Skip back

339 views Asked by At

I would like to achieve the following on Android 13+ using Androidx Media

  • respond to bluetooth headset SEEK_TO_NEXT and SEEK_TO_PREVIOUS commands
  • show custom drawable for previous/next icons in media notification

It seems that this is catch 22.

If we remove seek_to_previous/seek_to_next commands from available commands in a ForwardingPlayer, then the default icons are hidden in the media notification, and we can add a custom command that basically does the same thing. But then a bluetooth headset sending the command will be ignored.

If we add seek_to_next/seek_to_previous to the available commands, the system always puts its own drawable icon.

The system icons do not represent the action it's going to take which is a rewind / fast forward rather than skipping to the next media item. How can I either suppress these buttons or change the icons?

1

There are 1 answers

0
dabluck On BEST ANSWER

Media 3 1.2 added an API callback#onMediaButtonEvent that provides this functionality and makes the question moot.

https://github.com/androidx/media/releases/tag/1.2.0-rc01