hook up victory handler on onended on restart

This commit is contained in:
Kevin Ngo
2018-10-29 21:44:34 -07:00
parent 5c5ebfff7b
commit 4eb50faf63

View File

@@ -175,6 +175,7 @@ AFRAME.registerComponent('song', {
this.data.analyserEl.addEventListener('audioanalyserbuffersource', evt => {
this.source = evt.detail;
this.source.onended = this.victory;
this.el.sceneEl.emit('songloadfinish', null, false);
if (this.data.isBeatsPreloaded) { this.startAudio(); }
}, ONCE);