aboutsummaryrefslogtreecommitdiff
path: root/client/js/radio_emulator.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/js/radio_emulator.js')
-rw-r--r--client/js/radio_emulator.js7
1 files changed, 5 insertions, 2 deletions
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