react-native-track-player icon indicating copy to clipboard operation
react-native-track-player copied to clipboard

React native track player doesn't show "skip to next" button in background menu for some Android phones

Open nicksoft2020 opened this issue 1 year ago • 3 comments

React native track player works on Samsung phone correctly, but it does not show "skip to next" button in background menu for other Android phones like Redmi 9. I use 4.0.1 version of react native track player.

redmi 9 (screen 2) redmi 9 (screen 3) redmi 9 (screen 4) redmi 9 (screen 1)

I tried to use all available properties for Capabilities such as notificationCapabilities, compactCapabilities and capabilities, but it did not help me to fix an issue for Redmi 9 phone. There is setup track player function code below:

`try { await TrackPlayer.getCurrentTrack();

isSetup = true;

} catch { await TrackPlayer.setupPlayer(); await TrackPlayer.updateOptions({ android: { appKilledPlaybackBehavior: AppKilledPlaybackBehavior.StopPlaybackAndRemoveNotification, }, capabilities: [ Capability.Play, Capability.Pause, Capability.SkipToNext, Capability.SkipToPrevious, Capability.SeekTo ], compactCapabilities: [ Capability.Play, Capability.Pause, Capability.SkipToNext, Capability.SkipToPrevious, ], progressUpdateEventInterval: 2, });

await TrackPlayer.setRepeatMode(RepeatMode.Off);

isSetup = true;

} finally { return isSetup; }`

See my package.json

{ "scripts": { "start": "expo start --dev-client", "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web" }, "dependencies": { "@expo/webpack-config": "^19.0.0", "@react-native-async-storage/async-storage": "1.18.2", "@react-native-community/masked-view": "^0.1.11", "@react-native-community/slider": "4.4.2", "@react-navigation/bottom-tabs": "^6.5.8", "@react-navigation/native": "^6.1.7", "@react-navigation/stack": "^6.3.17", "expo": "^49.0.0", "expo-dev-client": "~2.4.11", "expo-location": "~16.1.0", "expo-media-library": "~15.4.1", "expo-splash-screen": "~0.20.5", "expo-status-bar": "~1.6.0", "expo-updates": "~0.18.14", "react": "18.2.0", "react-dom": "18.2.0", "react-native": "0.72.5", "react-native-gesture-handler": "^2.13.1", "react-native-paper": "^5.10.3", "react-native-reanimated": "^3.5.4", "react-native-safe-area-context": "^4.7.2", "react-native-screens": "^3.25.0", "react-native-track-player": "^4.0.1", "react-native-web": "~0.19.6", "recyclerlistview": "^4.2.0", "save": "^2.9.0" }, "devDependencies": { "@babel/core": "^7.20.0" }, "private": true }

Track player version: "react-native-track-player": "^4.0.1",

Android version: 12SP1A.210812.016 MIUI version: MIUI Global 13.0.2 Stable 13.0.2.0 (SJCMIXM)

Please check this issue. Thank you in advance.

nicksoft2020 avatar Feb 19 '24 09:02 nicksoft2020

its bc ur current exoplayer queue is the very last item and your android version is < 13. maybe setting exoplayer repeat mode to repeat helps, u can try taht.

lovegaoshi avatar Feb 19 '24 17:02 lovegaoshi

did you find a solution?

ser-emejia avatar Feb 23 '24 22:02 ser-emejia

did you find a solution?

Not yet

nicksoft2020 avatar Feb 29 '24 10:02 nicksoft2020

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] avatar May 30 '24 01:05 github-actions[bot]

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

github-actions[bot] avatar Jun 07 '24 01:06 github-actions[bot]

i came across this issue which is exactly whats described. https://github.com/androidx/media/issues/1708 for anyone interested you should wrap the forwardplayer in kotlinaudio to fix. i might be attempting a solution soon.

lovegaoshi avatar Sep 11 '24 18:09 lovegaoshi