How to update the url in react-native-track-player
?
The urls I have expire after 3 hours and I would like to be able to update them in case we would like to use the app in the morning and continue the music from where we left.
I tried the following:
- Get current track index and get the current position
- Using
remove(index)
to remove the current track from the queue - Regenerate the
Track
and add it to the queue usingadd()
- Seek to the position and playing the track again
The problem I faced with that approch was it didn't really remove the old one, rather just added the new one. And I don't know if it's the best way regarding performance ..
As a requirement, I must have unique tracks in the queue.
Thanks in advance!