From f9016a313e59a04acce6a48ff14f8d714a3d9248 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Thu, 11 Oct 2018 23:45:27 -0700 Subject: [PATCH] fix song preview switching --- src/components/song-preview.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/song-preview.js b/src/components/song-preview.js index bb028a3..a431028 100644 --- a/src/components/song-preview.js +++ b/src/components/song-preview.js @@ -42,6 +42,8 @@ AFRAME.registerComponent('song-preview-system', { // Selected challenge ID updated. if (data.selectedChallengeId && oldData.selectedChallengeId !== data.selectedChallengeId) { + if (this.audio) { this.stopSong(); } + // If not yet preloaded, pause the preload queue until this song is loaded. if (!this.preloadedAudioIds.includes(data.selectedChallengeId) && data.selectedChallengeId !== this.currentLoadingId) {