Fix looping
This commit is contained in:
parent
ba10e03143
commit
ab8699783d
|
@ -55,7 +55,7 @@ export const useTracks = createGlobalState(() => {
|
||||||
|
|
||||||
const createSoundPromise = async () => {
|
const createSoundPromise = async () => {
|
||||||
const sources = getTrackSources(track)
|
const sources = getTrackSources(track)
|
||||||
const { playTrack, currentIndex } = useQueue()
|
const { playNext } = useQueue()
|
||||||
|
|
||||||
const SoundImplementation = soundImplementation.value
|
const SoundImplementation = soundImplementation.value
|
||||||
const sound = new SoundImplementation(sources)
|
const sound = new SoundImplementation(sources)
|
||||||
|
@ -63,9 +63,7 @@ export const useTracks = createGlobalState(() => {
|
||||||
console.log('TRACK ENDED, PLAYING NEXT')
|
console.log('TRACK ENDED, PLAYING NEXT')
|
||||||
|
|
||||||
// NOTE: We push it to the end of the job queue
|
// NOTE: We push it to the end of the job queue
|
||||||
setTimeout(() => {
|
setTimeout(() => playNext(), 0)
|
||||||
playTrack(currentIndex.value + 1)
|
|
||||||
}, 0)
|
|
||||||
})
|
})
|
||||||
soundCache.set(track.id, sound)
|
soundCache.set(track.id, sound)
|
||||||
soundPromises.delete(track.id)
|
soundPromises.delete(track.id)
|
||||||
|
|
Loading…
Reference in New Issue