From 39691cbdb2b6290cf931d746e44d712e1b18fe3f Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Mon, 10 Dec 2018 18:39:52 -0800 Subject: [PATCH] song support ?skip url param --- src/components/song.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/song.js b/src/components/song.js index 0a20553..84b061b 100644 --- a/src/components/song.js +++ b/src/components/song.js @@ -4,6 +4,9 @@ const GAME_OVER_LENGTH = 3.5; const ONCE = {once: true}; const BASE_VOLUME = 0.75; +let skipDebug = AFRAME.utils.getUrlParameter('skip'); +if (!!skipDebug) { skipDebug = parseInt(skipDebug) / 1000; } + /** * Active challenge song / audio. * @@ -210,7 +213,7 @@ AFRAME.registerComponent('song', { gain.setValueAtTime(BASE_VOLUME, this.context.currentTime); this.songStartTime = this.context.currentTime; this.source.onended = this.victory; - this.source.start(); + this.source.start(0, skipDebug); this.isPlaying = true; },