doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.25k stars 1k forks source link

Duplicate actions in notification controller on Android 13+ #2321

Closed ouabing closed 9 hours ago

ouabing commented 4 months ago

Describe the Bug I've got reports from my users who uses ColorOS 13+(which is the default system on some OnePlus and Oppo devices), they found duplicate rewind and ff actions in notification controller. After digging for a while, I found KotlinAudio will add custom actions for rewind, ff and stop actions on Android 13+ aligning with the official behavior change, it still attempt to add these actions to ExoPlayer, which may result in duplicate actions on some custom Android system.

I have already create a PR to solve this issue, I'm posting this bug report here to see if there are any scenerios I might have missed.

20240531-144645

Steps To Reproduce Add Capability.JumpForward, Capability.JumpBackward or Capability.Stop to capabilities when invoking updateOptions

Code To Reproduce

Playback.updateOptions({
  forwardJumpInterval: 15,
  capabilities: [
    Capability.Play,
    Capability.JumpForward,
    Capability.JumpBackward
  ]
})

Replicable on Example App? Yes

Environment Info: Paste the results of npx react-native info 0.73.8 Paste the exact react-native-track-player version you are using 4.1.1 Real device? Or simulator? OnePlus Ace3 What OS are you running? ColorOS 14(Based on Android 14)

How I can Help See PR

lovegaoshi commented 3 months ago

thanks for the PR!

do u know if these specific OS providers map bluetooth events to forward/rewind as well when forward/rewind is enabled? like KeyEvent.KEYCODE_MEDIA_FAST_FORWARD (https://github.com/lovegaoshi/KotlinAudio/commit/a8990b57ae6cff0d85f9139d20d725ffbe224ed8). I wonder if for these OSes its better to use the native forward/rewind mapping instead of via custom actions. unrelated, the whole customaction system needs to be overhauled at some point.

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 9 hours ago

This issue was closed because it has been stalled for 7 days with no activity.