From 90d9f777edee8d93f1a9b452a47943a1a60fee3c Mon Sep 17 00:00:00 2001 From: kaotisk Date: Sun, 13 Oct 2024 21:17:43 +0300 Subject: Stopped reloading the page --- client/js/radio_emulator.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'client') diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js index 3e1e03b..4e0a885 100644 --- a/client/js/radio_emulator.js +++ b/client/js/radio_emulator.js @@ -187,7 +187,8 @@ function loadShowCallback(json, params) // } // }, {passive: true}); audioElement.addEventListener('ended', function(){ - location.reload(); + FetchJSON(`${listRequest}`, hashCallback, [ new Date().getTime() ]); + // location.reload(); }); // audioElement.addEventListener('complete', ()=>{ // debugLog("Download completed!") @@ -217,8 +218,17 @@ function sync_radio() audioElement.currentTime = new_now; audioElement.play(); audioElement.muted = false; - for ( av = 0.1; av === 1; av = av+0.1 ) - audioElement.volume = 0.1; + audioElement.volume = 0; + debugLog(Date.now()) + debugLog(Date.now()) + debugLog(Date.now()) + debugLog(Date.now()) + debugLog(Date.now()) + setTimeout( audioElement.volume += 0.2, 500); + setTimeout( audioElement.volume += 0.2, 1000); + setTimeout( audioElement.volume += 0.2, 1500); + setTimeout( audioElement.volume += 0.2, 2000); + setTimeout( audioElement.volume += 0.2, 2500); return new_now; } return 0; -- cgit v1.2.3