wait for audio buffer source when restarting
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -133,6 +133,7 @@ AFRAME.registerState({
|
||||
state.isBeatsPreloaded = false;
|
||||
state.isGameOver = false;
|
||||
state.isPaused = false;
|
||||
state.isSongLoading = true;
|
||||
},
|
||||
|
||||
gamemenuexit: (state) => {
|
||||
|
||||
Reference in New Issue
Block a user