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

When track is too long (25 minutes) playing from the middle calls state "ended" and track doesn't play

Open Ggayane opened this issue 1 year ago • 3 comments

Describe the Bug after I add a track (which is very long ~25minutes). I call TrackPlayer.seekTo to put let's say to 02:00 minute and then press play, player fires "buffering" then "playing" then "ended" then "paused" (all right after each other) and user can't play it anymore.

Steps To Reproduce try to add a track with 25minutes long and right after playing seek to at the middle of it.

Environment Info: react-native-track-player` version - 4.0.0-rc07 (but I've faced with this on 3.2.0 versions as well) platform - iOS

Ggayane avatar Sep 06 '23 14:09 Ggayane

I'm having a problem that may be related.

If you call TrackPlayer.getDuration(), does it give you the correct duration for the track?

I'm having a problem where my mp3 file actually has the incorrect duration embedded it. I do know what the correct duration is and I set that duration when adding the tracks to the queue.

The issue is that TrackPlayer does not seem to use the track metadata for determining the duration when using seekTo or useProgress.

I'm working if that is the issue you are running into and that your audio file is returning the wrong duration.

I'm only using v3.2, but if you are using v4, maybe you could try setting the problem duration of the track when adding the track to your queue and see if the newer version has "fixed" the duration issue.

markmccoid avatar Sep 09 '23 15:09 markmccoid

@markmccoid thanks and you are right the getDuration() function returns incorrect value, and when I set duration in metadata it still returns wrong value. I've also tested on version ^4.0.0-rc08 and issue still exists.

Ggayane avatar Sep 13 '23 09:09 Ggayane

How do you add tracks? I've had this wrong with TrackPlayer.add when adding more than one track. Now I use TrackPlayer.load instead and its working correctly.

nikenvy avatar Nov 23 '23 14:11 nikenvy

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 Feb 22 '24 01:02 github-actions[bot]

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

github-actions[bot] avatar Mar 01 '24 01:03 github-actions[bot]