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
java.lang.IllegalArgumentException
at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:40)
at androidx.media3.session.DefaultActionFactory.createCustomActionFromCustomCommandButton(DefaultActionFactory.java:88)
at androidx.media3.session.DefaultMediaNotificationProvider.addNotificationActions(DefaultMediaNotificationProvider.java:318)
at org.moire.ultrasonic.playback.MediaNotificationProvider.addNotificationActions(MediaNotificationProvider.kt:62)
There is a check that enforces only custom session commands to be used. Why is it there?
We would like to use the built-in command...
Media
--
Bug Report
You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.
The text was updated successfully, but these errors were encountered:
In general I think the best approach is to use MediaSession.Callback.onCustomCommand and MediaSession.setCustomLayout(). If you do that, the DefaultMediaNotificationProvider will handle this for you and then make sure that this works on Android 12 and earlier as well as on Android 13.
You can see how this is done in the demo app. There is also issue #38 that explains this in a bit more detail.
The customLayout is replicated in the legacy session as custom actions. This way the library is handling that for you. There are two types of command: a) player commands, these are commands that the library can handle themselves because it's clear what Player method to call. b) Then there's all other commands that need the app to do something. All of these are custom commands and need to be replicated in the legacy session as 'custom actions'. You want to see these custom actions on Android 12 and earlier as notification actions, and from Android 13, these actions need to be converted to custom actions in the legacy session.
The library does all these things for you. The price you pay for this is that you need to accept to do this as a custom command. If you do that no changes are needed regarding the DefaultMediaNotificationProvider. You only need to join the customLayout concept. The alternative is to implement this all on your end which is possible, but you are rewriting a good amount of code that the library would provide.
Media3 Version
1.0.0-beta01
Devices that reproduce the issue
All
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
We want to add a custom "like/unlike" button to the notification.
Expected result
The button is added correctly.
Actual result
A crash at
There is a check that enforces only custom session commands to be used. Why is it there?
We would like to use the built-in command...
Media
--
Bug Report
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.The text was updated successfully, but these errors were encountered: