useTrackPlayerEvents([Event.PlaybackQueueEnded], async event => { if (event.type === Event.PlaybackQueueEnded && event.nextTrack !== undefined) { TrackPlayer.stop(); } });