react-native-track-player
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
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
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 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.
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.
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.