Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nicksoft2020 opened this issue Feb 19, 2024 · 4 comments

Comments

@nicksoft2020
Copy link

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.

@lovegaoshi
Copy link
Contributor

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.

@ser-emejia
Copy link

did you find a solution?

@nicksoft2020
Copy link
Author

did you find a solution?

Not yet

Copy link
Contributor

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 github-actions bot added the Stale label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants