From b2f77d7f70b289275543160acc3b9d7e4d76dcc5 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Fri, 12 Oct 2018 15:43:21 -0700 Subject: [PATCH] check analyser volume to decide whether to pause during song loading process --- src/components/song-preview.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/song-preview.js b/src/components/song-preview.js index bbf4bdf..2e44044 100644 --- a/src/components/song-preview.js +++ b/src/components/song-preview.js @@ -63,7 +63,9 @@ AFRAME.registerComponent('song-preview-system', { // But don't start playing it if it wasn't playing already. if (!oldData.isSongLoading && data.isSongLoading) { - if (this.audio.currentTime < 1) { this.stopSong(); } + if (this.analyserEl.components.audioanalyser.volume === 0) { + this.stopSong(); + } return; }