Replies: 1 comment
-
I had to add For instance: useTrackPlayerEvents([Event.PlaybackActiveTrackChanged], async event => {
if (isCurrentTrack && event.track.id !== item.id) {
await TrackPlayer.stop();
setSliderValue(0);
}
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the settings of my app, I will like to offer the user the option to stop the player when a track completes.
But react-native-track-player always plays the next track in the queue. This behaviour seems hardcoded. I don't see any event or hook to change this.
Calling TrackPlayer.pause() in the Event.PlaybackTrackChanged handler would have the effect to also pause when the user press NEXT button, which I obviously don't want . I guess I could use a global value with useRef, but I hope there is a nicer solution.
And of course, I would like to avoid implementing my own queue externally (with only one track in react-native-track-player queue).
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions