From 926c843a5f45bc79ac1d9f3f59cb379fef04043e Mon Sep 17 00:00:00 2001 From: kaotisk Date: Tue, 12 Nov 2024 03:04:41 +0200 Subject: Fix bug --- client/index.html | 1 + client/js/radio_emulator.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/index.html b/client/index.html index db4d0eb..9d0ef33 100644 --- a/client/index.html +++ b/client/index.html @@ -46,6 +46,7 @@
+
diff --git a/client/js/radio_emulator.js b/client/js/radio_emulator.js index 3687ffb..13d874e 100644 --- a/client/js/radio_emulator.js +++ b/client/js/radio_emulator.js @@ -202,7 +202,7 @@ function loadShowCallback(json, params) debugLog(listItem); //debugLog(params); audioElement.load(); - FetchAudio(`${audioRequest}${json.hash}`, genericCallback); + FetchAudio(`${audioRequest}${json.hash}`, sync_radio); audioElement.type = json.mimetype; values.current_time = Math.floor((values.now_on_sequence/1000)); // - listItem.starts_on)/1000); updateComponentsAfterLoadShowCallback(json, listItem); @@ -233,7 +233,6 @@ function fadeInAudio() function sync_radio() { - FetchJSON(`${listRequest}`, hashCallback, [ new Date().getTime() ]); var new_now = values.current_time + getSecondsHere(); debugLog("Trying to sync @ "+ values.current_time + " + " + getSecondsHere() + " = " + new_now); audioElement.currentTime = new_now; @@ -371,5 +370,9 @@ function hashCallback(json, params) FetchJSON(`${jsonRequest}${json.latest_list}`, listCallback, [now, json.latest_list]); } +function start_radio() +{ + FetchJSON(`${listRequest}`, hashCallback, [ new Date().getTime() ]); +} // @license-end -- cgit v1.2.3