Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 13 Media3 Notification Skip back

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?

like image 489
dabluck Avatar asked Jun 08 '26 11:06

dabluck


1 Answers

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

like image 168
dabluck Avatar answered Jun 10 '26 11:06

dabluck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!