diff --git a/src/components/song.js b/src/components/song.js index 5d71cf1..82db593 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -124,6 +124,7 @@ AFRAME.registerComponent('song', { if (this.source) { this.source.disconnect(); } this.data.analyserEl.addEventListener('audioanalyserbuffersource', evt => { this.source = evt.detail; + this.el.sceneEl.emit('songloadfinish', null, false); if (this.data.isBeatsPreloaded) { this.source.start(); } }, ONCE); this.audioAnalyser.refreshSource(); diff --git a/src/state/index.js b/src/state/index.js index 9fa0fdf..68fce0c 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -133,6 +133,7 @@ AFRAME.registerState({ state.isBeatsPreloaded = false; state.isGameOver = false; state.isPaused = false; + state.isSongLoading = true; }, gamemenuexit: (state) => {