Closed willdspd closed 3 years ago
Same issue here, and sometimes it plays the previous song for a couple of seconds, before playing what was supposed to be playing
is this still active?
is this still active?
https://github.com/react-native-kit/react-native-track-player/issues/1105
This is a major issue for using this package. Currently working around it by pausing with a timeout (800ms), hoping that next track get loaded on skip/skipTo during that time and then playing again. Not optimal as it adds additional pausing between tracks and sometimes previous track can keep playing for a number of seconds still.
Any ideas for how to solve greatly appreciated.
@dcvz any reason why you closed this? Still seems to be an issue 🤔
issue still occurs plz help
I am on 3.2 but this is happening to me. Anyone know if it's fixed in 4.1?
I was able to fix my issue by waiting for "connecting" to finish before calling play.
let asdf;
do {
asdf = await TrackPlayer.getState();
} while (asdf == State.Connecting);
Describe the bug
In my application, I have a list of tracks that I add to TrackPlayer. When the user clicks one of these tracks (let's call it Track 1) in the UI (as can be seen in the screenshot below) I call the below function to play the track:
Then, when a user wants to pause this specific track, I call this function:
This works with no problems. So far so good. Then, if the user clicks another track (let's call it Track 2) to play it, I call this line:
This is when the problem occurs. Instead of immediately playing the next track that the user just clicked (Track 2), the Player plays the previous track (Track 1) for approximately 0.5/1 seconds, before playing the correct track (Track 2). Furthermore, this problem also occurs when the user tries to play Track 2 without pausing Track 1 first. Naturally, this is a very poor listening experience for the user.
Separate to this bug, but also relevant to the second use case I just mentioned, is the question of the 'Gapless playback' feature that was part of this release of react-native-track-player in 2018. Naturally, this would solve our issue to some degree (ignoring the fact that audio from Track 1 should never play after Track 2 has been clicked), but obviously, it doesn't seem to be a feature that works out of the box. Is this something we have to set up ourselves? If so, how do we do this? We don't seem to be the only ones asking about this.
To Reproduce
Please follow the steps outlined above. If desired, I can give access to our repo for you to clone our project to check out the problem for yourself.
Environment
What
react-native-track-player
version are you using?1.2.3
Are you testing on a real device or in the simulator? Which OS version are you running?
iOS Simulator
Screenshot of tracks