diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-11-12 03:04:41 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-11-12 03:04:41 +0200 |
commit | 926c843a5f45bc79ac1d9f3f59cb379fef04043e (patch) | |
tree | beb28e23e7e34c9e8de32f9f191df88d2e370d6b /client/js/radio_emulator.js | |
parent | da40e85c746c623826544076199be33bc46479e7 (diff) | |
download | arching-kaos-radio-926c843a5f45bc79ac1d9f3f59cb379fef04043e.tar.gz arching-kaos-radio-926c843a5f45bc79ac1d9f3f59cb379fef04043e.tar.bz2 arching-kaos-radio-926c843a5f45bc79ac1d9f3f59cb379fef04043e.zip |
Fix bug
Diffstat (limited to 'client/js/radio_emulator.js')
-rw-r--r-- | client/js/radio_emulator.js | 7 |
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 |