From 553d150ee6573f3b8dfcd5aed171e3baf09c3b9d Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Tue, 25 Sep 2018 06:03:07 -0700 Subject: [PATCH] fix preview start time --- src/components/song-preview.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/song-preview.js b/src/components/song-preview.js index b530604..f35ed52 100644 --- a/src/components/song-preview.js +++ b/src/components/song-preview.js @@ -93,7 +93,7 @@ AFRAME.registerComponent('song-preview-system', { const audio = document.createElement('audio'); audio.crossOrigin = 'anonymous'; - // audio.currentTime = previewStartTime; + audio.dataset.previewStartTime = previewStartTime; audio.volume = 0; this.audioStore[challengeId] = audio; @@ -155,6 +155,7 @@ AFRAME.registerComponent('song-preview-system', { this.audio = this.audioStore[challengeId]; this.audio.volume = 0; this.volumeTarget.volume = 0; + this.audio.currentTime = this.audio.dataset.previewStartTime; this.audio.play(); this.animation.restart(); this.updateAnalyser();