Mantiene la copertina YouTube se il telefono cade e avvia ffmpeg sul nodo, non via SSH.
Il relay HLS→RTMPS resta sul worker/agent del nodo assegnato, così tre dirette contemporanee restano in onda sul sito e sul canale della società senza schermo nero. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
</div>
|
||||
<p id="offline-msg" class="live-status-msg" hidden><%= t("live.show.offline_msg") %></p>
|
||||
<p id="awaiting-msg" class="live-status-msg" hidden><%= t("live.show.awaiting_msg") %></p>
|
||||
<p id="reconnecting-msg" class="live-status-msg" hidden><%= t("live.show.js_reconnecting_awaiting") %></p>
|
||||
<p id="paused-msg" class="live-status-msg" hidden><%= t("live.show.paused_msg") %></p>
|
||||
|
||||
<script>
|
||||
@@ -63,25 +64,26 @@
|
||||
const offlineMsg = document.getElementById("offline-msg");
|
||||
const pausedMsg = document.getElementById("paused-msg");
|
||||
const awaitingMsg = document.getElementById("awaiting-msg");
|
||||
const reconnectingMsg = document.getElementById("reconnecting-msg");
|
||||
const playHint = document.getElementById("play-hint");
|
||||
const streamBadge = document.getElementById("live-stream-badge");
|
||||
|
||||
function syncStreamBadge(data) {
|
||||
if (!streamBadge) return;
|
||||
if (data.stream_closed) {
|
||||
streamBadge.textContent = "<%= j t("live.overlays.badge_ended") %>";
|
||||
streamBadge.textContent = <%= raw t("live.overlays.badge_ended").to_json %>;
|
||||
streamBadge.className = "live-ovl-badge live-ovl-badge--right badge-ended";
|
||||
return;
|
||||
}
|
||||
const paused = !!(data.paused || data.status === "paused");
|
||||
if (paused) {
|
||||
streamBadge.textContent = "<%= j t("live.index.badge_paused") %>";
|
||||
streamBadge.textContent = <%= raw t("live.index.badge_paused").to_json %>;
|
||||
streamBadge.className = "live-ovl-badge live-ovl-badge--right badge-wait";
|
||||
} else if (data.on_air) {
|
||||
streamBadge.textContent = "<%= j t("live.index.badge_live") %>";
|
||||
streamBadge.textContent = <%= raw t("live.index.badge_live").to_json %>;
|
||||
streamBadge.className = "live-ovl-badge live-ovl-badge--right badge-live";
|
||||
} else {
|
||||
streamBadge.textContent = "<%= j t("live.overlays.badge_waiting") %>";
|
||||
streamBadge.textContent = <%= raw t("live.overlays.badge_waiting").to_json %>;
|
||||
streamBadge.className = "live-ovl-badge live-ovl-badge--right badge-wait";
|
||||
}
|
||||
}
|
||||
@@ -282,9 +284,10 @@
|
||||
if (onAir || sessionLive) {
|
||||
offlineMsg.hidden = true;
|
||||
if (!publisherOnline && showingCover && !paused) {
|
||||
awaitingMsg.hidden = false;
|
||||
awaitingMsg.textContent = "<%= j t("live.show.js_reconnecting_awaiting") %>";
|
||||
awaitingMsg.hidden = true;
|
||||
if (reconnectingMsg) reconnectingMsg.hidden = false;
|
||||
} else {
|
||||
if (reconnectingMsg) reconnectingMsg.hidden = true;
|
||||
awaitingMsg.hidden = !awaitingSignal;
|
||||
}
|
||||
pausedMsg.hidden = !paused;
|
||||
@@ -299,6 +302,7 @@
|
||||
} else {
|
||||
offlineMsg.hidden = false;
|
||||
awaitingMsg.hidden = true;
|
||||
if (reconnectingMsg) reconnectingMsg.hidden = true;
|
||||
pausedMsg.hidden = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user