audio_service
audio_service copied to clipboard
Play button on notification panel is always disable for iOS
Documented behaviour
playbackState.add(playbackState.value.copyWith( controls: [MediaControl.play, MediaControl.skipToNext, MediaControl.skipToPrevious], processingState: AudioProcessingState.ready, playing: false, )); _player.pause(); // even with or without this line, play button on notification always disabled
Actual behaviour
Step to reproduce:
- Base on the example_multiple_handlers.dart example I want to pause after playing a bit.
- After pause, the paused button on notication panel was changed to play button, but it should be enabled to be able to click it to play the media.
Please help me resolve this issue. Thank you!
Minimal reproduction project
Official example: example_multiple_handlers.dart
Reproduction steps
- Play
- Pause by using button in the example app
- Play button should be shown in notification panel with enable state instead of disable
Output of flutter doctor
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google
Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] HTTP Host Availability```
### Devices exhibiting the bug
iOS 16.5
I have the same issue. you can also use that method instead of MediaControl.play
if (_playing) MediaControl.pause else const MediaControl( androidIcon: 'drawable/audio_service_play_arrow', label: 'Play', action: MediaAction.playPause, ),
@lecanhhiep I was unable to reproduce the issue. Do you have a screen recording? Also, you didn't mention in your bug report whether you were using a real iOS device or a simulator, and which specific device you were simulating in the latter case.
@TanYF123 I don't understand how setting the androidIcon
would have any effect on an issue about iOS. If you experience the issue on iOS, please also share a screen recording.
playPause
https://github.com/ryanheise/audio_service/assets/38818659/e08eb7db-4611-4aea-8ddb-40fb0f6169e4
i had reproduced the issue and made a screen record of it and attached above, hope this will help you to sort down the issue.