From aca7143449476c7cb77ff839bef0f9bbdcb7c642 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 9 Nov 2018 13:41:07 +1300 Subject: [PATCH] Fix interstitial music not playing at Interface start-up --- scripts/system/interstitialPage.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 7516bb7327..b7c5809b3a 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -285,12 +285,21 @@ } } + function restartAudio() { + tune.ready.disconnect(restartAudio); + startAudio(); + } + function startAudio() { - sample = Audio.playSound(tune, { - localOnly: true, - position: MyAvatar.getHeadPosition(), - volume: VOLUME - }); + if (tune.downloaded) { + sample = Audio.playSound(tune, { + localOnly: true, + position: MyAvatar.getHeadPosition(), + volume: VOLUME + }); + } else { + tune.ready.connect(restartAudio); + } } function endAudio() {