Open rd-wang opened 3 days ago
https://developer.android.com/about/versions/13/behavior-changes-13?hl=zh-cn#playback-controls Because slot 1 of android controls cannot be customized, the function of slot 1 cannot be modified?
Can you submit a bug report in English following the instructions?
Can you submit a bug report in English following the instructions?
sorry, I have modified the description。 maybe is not issue,but i have no idea for that。
If you want to ask a question about how set the icons on Android, please follow the instructions on the New Issue page which direct you to StackOverflow (the question asking/answering site). If you find the answer, hopefully it works for you. If you discover that you need me to expose more of the Android API in this plugin, you can come back here and submit a feature request detailing exactly what parts of the API are missing.
If you want to ask a question about how set the icons on Android, please follow the instructions on the New Issue page which direct you to StackOverflow (the question asking/answering site). If you find the answer, hopefully it works for you. If you discover that you need me to expose more of the Android API in this plugin, you can come back here and submit a feature request detailing exactly what parts of the API are missing.
this is a problem
when i clear controls setting or not set controls
PlaybackState( controls:[], ... ) PlaybackState( ... )
there is a default pause and play icon in notification
this is because com/ryanheise/audioservice/AudioService.java line 75 AUTO_ENABLED_ACTIONS
set bitmask of the available capabilities.
| PlaybackStateCompat.ACTION_PAUSE
| PlaybackStateCompat.ACTION_PLAY
| PlaybackStateCompat.ACTION_PLAY_PAUSE
remove this bitmask
there is no controls in notification match the empty controls setting or not set controls
Documented behaviour
Actual behaviour
Question: How to replace the default play/pause icon in notification Phenomenon: Modify the button control in the notification in the controls parameter of PlaybackState, clear the list, and there will be a default play/pause icon switching function on the UI;
Add
MediaControl.play
with the same name but replace the iconMediaControl.play.copyWith(androidIcon: "drawable/baseline_forward_30_24")
that displays the default icon;Adding a picture with the same name as the default icon to the drawable cannot replace the default play and pause icons. But stop can be replaced. The image is not modified:
MediaControl.pause.copyWith(androidIcon: "drawable/audio_service_stop")
, Image modification:MediaControl.stop
, Image modification:MediaControl.rewind.copyWith(androidIcon: "drawable/audio_service_stop")
,Add a custom type of controls, and the icon can take effect normally.
In the example you provided, you can reproduce this problem by directly modifying the content in controls. No other modifications are required.
Minimal reproduction project
Official example: example_android13.dart
Reproduction steps
Modify the control parameter content in the _transformEvent method and add the corresponding test image to the drawable.
Output of flutter doctor
It has nothing to do with flutter
Devices exhibiting the bug
android 14 ,Huawei Honor pro9