From 0c03497f4ccfd238e5e9a4807c66a4f8ff41a79c Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Tue, 11 Dec 2018 05:44:57 -0800 Subject: [PATCH] make sure skipdebug is zeroed --- src/components/song.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/song.js b/src/components/song.js index 84b061b..a892896 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -5,7 +5,11 @@ const ONCE = {once: true}; const BASE_VOLUME = 0.75; let skipDebug = AFRAME.utils.getUrlParameter('skip'); -if (!!skipDebug) { skipDebug = parseInt(skipDebug) / 1000; } +if (!!skipDebug) { + skipDebug = parseInt(skipDebug) / 1000; +} else { + skipDebug = 0; +} /** * Active challenge song / audio. @@ -213,7 +217,7 @@ AFRAME.registerComponent('song', { gain.setValueAtTime(BASE_VOLUME, this.context.currentTime); this.songStartTime = this.context.currentTime; this.source.onended = this.victory; - this.source.start(0, skipDebug); + this.source.start(0, skipDebug || 0); this.isPlaying = true; },