genre / num beats / song length / upvotes / downvotes from updated search index

This commit is contained in:
Kevin Ngo
2018-10-27 03:45:26 -07:00
parent 4e71423cd8
commit b7a5f47837
3 changed files with 12 additions and 31 deletions

View File

@@ -177,8 +177,6 @@ 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'));

View File

@@ -31,7 +31,9 @@ AFRAME.registerComponent('song-progress-ring', {
const source = this.el.sceneEl.components.song.source;
if (!source) { return; }
const progress = this.context.currentTime / source.buffer.duration;
const progress =
this.el.sceneEl.components.song.getCurrentTime() /
source.buffer.duration;
this.progress.value = progress;
}
});