react-native-track-player
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
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.
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.
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.
did you find a solution?
did you find a solution?
Not yet
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.
This issue was closed because it has been stalled for 7 days with no activity.
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.