audio_service icon indicating copy to clipboard operation
audio_service copied to clipboard

Unable to set media controls with Android 13 (compileSdkVersion 33). Only pause shows up on the lock-screen media player.

Open hboothe11233 opened this issue 3 years ago • 1 comments

Documented behaviour

PlaybackState _transformEvent(PlaybackEvent event) { final playing = player.playing;

return PlaybackState(
  controls: [
    MediaControl(androidIcon: 'drawable/go_back', label: "Back", action: MediaAction.rewind),
    if (playing) MediaControl.stop else MediaControl.play,
    MediaControl(androidIcon: 'drawable/go_forward', label: "Forward", action: MediaAction.fastForward)
  ],
  systemActions: const {
    MediaAction.rewind,
    MediaAction.stop,
    MediaAction.fastForward,
  },
  androidCompactActionIndices: const [ 0, 1, 2],

Actual behaviour

Pause shows on the lock-screen media player.

Minimal reproduction project

Official example: main.dart

Reproduction steps

Play audio within the app. Pull down from top edge to view notification/ lock-screen.

Output of flutter doctor

[✓] Flutter (Channel stable, 3.3.2, on macOS 12.6 21G115
    darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices
    (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Android Studio (version 2021.2)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

• No issues found!```
### Devices exhibiting the bug
Google Pixel 6, with Android 13

hboothe11233 avatar Sep 17 '22 21:09 hboothe11233

Copy and paste the sentence(s) from the API documentation that isn't working correctly Note: the API documentation is here. You may consider submitting a documentation request or a feature request instead if the documentation isn't clear or your feature isn't supported.

It's not too hard to copy and paste sentence(s) from the documentation is it?

Documented behaviour

PlaybackState _transformEvent(PlaybackEvent event) { final playing = player.playing;

return PlaybackState(
  controls: [
    MediaControl(androidIcon: 'drawable/go_back', label: "Back", action: MediaAction.rewind),
    if (playing) MediaControl.stop else MediaControl.play,
    MediaControl(androidIcon: 'drawable/go_forward', label: "Forward", action: MediaAction.fastForward)
  ],
  systemActions: const {
    MediaAction.rewind,
    MediaAction.stop,
    MediaAction.fastForward,
  },
  androidCompactActionIndices: const [ 0, 1, 2],

That is not copied and pasted from anywhere in the API documentation.

I need the documentation because if it is a bug, that will help me determine that it is a bug (which is defined by the actual behaviour being different from the documented behaviour). Or, if the documentation is wrong, that will help me know which documentation needs to be fixed.

ryanheise avatar Sep 18 '22 02:09 ryanheise