Solvedreact native track player v2 [@next, rc-18 published]
✔️Accepted Answer
The last publish to npm was done 6 months ago, has there been any progress since then and if so can it please be put into a new RC?
Yes, we'll eventually publish a new version, there are quite a few bug fixes and new features that we've been working on in the last few weeks (you can see the progress in the v2 branch).
There's no up-to-date v2.0.0 documentation available anywhere (please do direct me to it if I'm wrong), could we get something more than the odd comment and/or bullet point in random, scattered issues? It would make sense to me to actively keep the documentation up-to-date in the v2 branch (if that's even what's being used)
There is in the docs
folder in the v2 branch. It's not fully updated yet, but most of the new features are already there.
Again, I do appreciate this package, it's a great piece of work and I'd love to keep using it, however, it seems it's been abandoned or neglected, so could we please get an update?
We've been discussing a bit of that on #703
Other Answers:
@dcvz After playing around with rc13 some more it seems there are some fundamental issues with getPosition
and getDuration
on iOS. I'll try and put together a small repro so you can examine what's going on but essentially two huge problems are:
-
getDuration
is not consistent. After setting up the TrackPlayer and callingawait TrackPlayer.add(tracks)
callingawait TrackPlayer.getDuration()
after might return 0 or might return the true duration. All we know is that it's wrong when its 0 so the hack right now is to setup an interval and wait until it starts returning a non-zero value. So for this API and for theuseProgress
hook to work properly we need fix whatever race condition exists here and always return a non-zero duration after we've added tracks. Maybe there is another function we need to await for but there exists some obvious race condition here. -
getPosition
also is not consistent. After setting up the TrackPlayer and callingawait TrackPlayer.add(tracks)
andawait TrackPlayer.seekTo(newPosition)
callingawait TrackPlayer.getPosition()
may return 0 or may returnnewPosition
. Again there has to be some race condition getting in the way here. I've checked that I'm only callingseekTo
in one spot and awaiting that to finish. This one usually never returns the newPosition until the podcasts has started playing even if we do the hack I wrote about here to runTrackPlayer.play(); await TrackPlayer.seekTo(newPosition); TrackPlayer.pause()
Really not sure what's going on here. In the meantime I need to revert back to the v1.x.x for my own app, but after I get that back to working I'll try to put together a small repro to illustrate these bugs.
If you're absolutely not noticing these race conditions then I think the project that we're testing the library in must be getting around the race conditions however I can guarantee they exist in this project and we're going to need to solve them to move forward with the v2
Thanks everyone for the reports! Officially v2 is now out!
We've also gone through and mass cleaned the issues log in an effort to give us a better chance of maintaining this library and fixing new issues. If there's any issues with v2 please report them :)
We'll focus on stabilising any new issues + queue manipulations like shuffle and reordering.
Not to muddy the waters and seem ungrateful for all the wonderful work being done, but can we please get an update on how the release is going and what is and isn't being worked on if anything? I've spent the last week trying to get RC13 up and running to no avail, because the useProgress()
hook is broken and returns 0 as @CaptainRedBeard described, along with a handful of other issues.
-
The last publish to
npm
was done 6 months ago, has there been any progress since then and if so can it please be put into a new RC? -
There's no up-to-date v2.0.0 documentation available anywhere (please do direct me to it if I'm wrong), could we get something more than the odd comment and/or bullet point in random, scattered issues? It would make sense to me to actively keep the documentation up-to-date in the v2 branch (if that's even what's being used)
Again, I do appreciate this package, it's a great piece of work and I'd love to keep using it, however, it seems it's been abandoned or neglected, so could we please get an update?
Also, sorry if this isn't the perfect spot to post this or if there's an answer to my questions in some other random issue, I just couldn't find anything else.
v2.0.0
Changes
API for shuffling play of queue (deferred)API for moving an item at an index to another index (deferred)playback-metadata-received
event to be notified of metadata changes on streams #1175 (rc-15)Add a newplayback-about-to-end
event to provide a chance for loading next track data. - (See #818 (comment))To update run
yarn add react-native-track-player@next
. Breaking changes are outlined below:Migrating to RN 0.60
We've migrated to AndroidX, please follow migration instructions provided by the ReactNative team.
Exports Updated
PR: #654 has changed the default export to only include methods on the player.
State
,Capability
,PitchAlgorithm
,TrackType
andEvent
are now exported as enums.Progress Hook Renamed
The hook
useTrackPlayerProgress()
has been fixed and renamed:useProgress()
. The return has also been modified:bufferedPosition
is nowbuffered
.