store song duration and length in state
This commit is contained in:
@@ -97,6 +97,7 @@ AFRAME.registerComponent('beat-loader', {
|
||||
*/
|
||||
handleBeats: function (beatData) {
|
||||
this.el.sceneEl.emit('beatloaderfinish', beatData, false);
|
||||
|
||||
// Reset variables used during playback.
|
||||
// Beats spawn ahead of the song and get to the user in sync with the music.
|
||||
this.beatsTimeOffset = this.data.beatAnticipationTime * 1000;
|
||||
|
||||
@@ -177,6 +177,8 @@ AFRAME.registerComponent('song-preview-system', {
|
||||
this.fadeIn();
|
||||
this.updateAnalyser();
|
||||
|
||||
this.el.sceneEl.emit('menuselectedchallengesonglength', this.audio.duration, false);
|
||||
|
||||
// Prefetch buffer for playing.
|
||||
if (audioanalyser.xhr) { audioanalyser.xhr.abort(); }
|
||||
audioanalyser.fetchAudioBuffer(utils.getS3FileUrl(challengeId, 'song.ogg'));
|
||||
|
||||
Reference in New Issue
Block a user