From ab8699783da0af504e6fa5707696f3ec62f40588 Mon Sep 17 00:00:00 2001 From: wvffle Date: Fri, 28 Oct 2022 16:55:57 +0000 Subject: [PATCH] Fix looping --- front/src/composables/audio/tracks.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/front/src/composables/audio/tracks.ts b/front/src/composables/audio/tracks.ts index a02f39e09..4210fecc3 100644 --- a/front/src/composables/audio/tracks.ts +++ b/front/src/composables/audio/tracks.ts @@ -55,7 +55,7 @@ export const useTracks = createGlobalState(() => { const createSoundPromise = async () => { const sources = getTrackSources(track) - const { playTrack, currentIndex } = useQueue() + const { playNext } = useQueue() const SoundImplementation = soundImplementation.value const sound = new SoundImplementation(sources) @@ -63,9 +63,7 @@ export const useTracks = createGlobalState(() => { console.log('TRACK ENDED, PLAYING NEXT') // NOTE: We push it to the end of the job queue - setTimeout(() => { - playTrack(currentIndex.value + 1) - }, 0) + setTimeout(() => playNext(), 0) }) soundCache.set(track.id, sound) soundPromises.delete(track.id)