-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option (boolean) to auto advance to the next track #918
Comments
@Guichaguri is this an easy add on Android? On iOS, SwiftAudio has a setting we can toggle. However, looking briefly at Exoplayer, it seems ConcatenatingMediaSource doesn’t have an easy way to disable auto advancing. Which makes sense because seamless playback is the whole point. Can we easily switch between media source types or something? |
It's doable, but not very precisely with the ConcatenatingMediaSource. Pausing in |
I think I had tried that for some other reason and you end up getting blips of the next track 😞 |
I guess we should determine if this is necessary. Devs can always just not use the RNTP queue and do a single track at a time. This can possibly cause issues when trying to change to the next track in the background though. |
Guess what? |
Nice! So what approach do you think makes sense for exposing this in the TrackPlayer API? Also, would we need a new playback event to know when the track is complete? |
I think we should still advance into the next track as expected, but set it to the paused state. It would make sense to add a setter/getter for that, as |
hmm, I'll have to check, but I don't think this would match the default behavior on iOS by just disabling the auto play feature of SwiftAudio. On iOS I don't think it would go to the next track. But that may be easy to tweak. |
ExoPlayer doesn't advance either, so I don't know whether we should add a new event just for that or advance the track. You can probably listen to |
Maybe this would be related to other requests I have noticed regarding how to know when a track actually finished? A new event, such as |
Yeah, that should work |
guys any update related to |
This It would be important to add it since people moving here from |
I also ejected from expo and was using the The 2 main things we would want on a track's finish:
|
Hey guys - so are you saying there is no way to stop this from auto-advancing on iOS? Like, if I have more than one track loaded it's not possible for me to prevent it from playing all the tracks in the queue? Also, plus one for an 'onEnded' event. I kind of can't believe this library doesn't have this |
any updates on auto-play = false - behaviour? |
If someone is looking for a workaround. I'm doing the next:
I hope it helps. NOTE: I'm using "^1.2.7" version. |
Thank you so much @edgargrs for your help on this I was able to add this to my existing application like so. The TrackPlayers API has updated so this is for version 2.1.3. Make sure you are not trying to put this useTrackPlayerEvents function within a hook. I simply threw it under my useMemo in my main app screen.
|
@dcvz Why did you close this? Is this feature implemented? |
Is your feature request related to a problem? Please describe.
I'm unable to stop the track from auto-advancing to the next track. See Issue 917. I tried to stop the track from advancing with pause but it doesn't pause.
Describe the solution you'd like
Add a configuration option that lets you choose whether the track auto-advances to the next track or pauses after finishing. Right now the tracks all auto-advance if there is a next track.
Describe alternatives you've considered
Add the ability to pause in the event listener: Issue 917
Additional context
In our app, a user loads a playlist of tracks. They have a setting to choose whether the app should play the next track automatically or stop after each track. I would like to be able to update the Track Player config to reflect the user's choice of setting.
The text was updated successfully, but these errors were encountered: