mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-07-29 15:29:14 +02:00
fix sync
This commit is contained in:
+2
-4
@@ -55,8 +55,6 @@ function initLayout() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── WebSocket ───────────────────────────────────────────────────────────────
|
|
||||||
|
|
||||||
function connectWs() {
|
function connectWs() {
|
||||||
const statusEl = document.getElementById("server-status");
|
const statusEl = document.getElementById("server-status");
|
||||||
statusEl.textContent = "connecting...";
|
statusEl.textContent = "connecting...";
|
||||||
@@ -88,10 +86,10 @@ function connectWs() {
|
|||||||
|
|
||||||
function syncTime() {
|
function syncTime() {
|
||||||
wsSend({ action: "get_time", client_time: performance.now() / 1000 });
|
wsSend({ action: "get_time", client_time: performance.now() / 1000 });
|
||||||
|
setInterval(syncTime, 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(syncTime, 10000);
|
setInterval(syncTime, 500);
|
||||||
syncTime(); // initial sync
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function wsSend(obj) {
|
function wsSend(obj) {
|
||||||
|
|||||||
Reference in New Issue
Block a user