Apply remaining changes

This commit is contained in:
2026-08-05 21:57:16 +01:00
parent a6a5d71ef0
commit b9dd4178c4
10 changed files with 469 additions and 20 deletions
-12
View File
@@ -395,18 +395,6 @@ body.screen-blackout #app {
white-space: pre-wrap;
}
.template-region.text > *,
.template-region.api > *,
.template-region.rss > * {
margin: 0;
}
.template-region.text > * + *,
.template-region.api > * + *,
.template-region.rss > * + * {
margin-top: 0.5em;
}
.template-region.text ul,
.template-region.text ol,
.template-region.api ul,
+1 -1
View File
@@ -133,7 +133,7 @@ function scheduleSlideAdvance(delayMs) {
applyPendingPlaylistUpdate();
const activeSlides = getCurrentActiveSlides();
if (activeSlides.length < 2) {
refresh();
showCurrent();
return;
}
if (index >= activeSlides.length) {
+19 -3
View File
@@ -99,6 +99,16 @@ function showCurrent() {
lastRenderedViewKey = getCurrentRenderKey(activeSlides);
}
function isSlideInList(slide, slideList) {
if (!slide || !Array.isArray(slideList)) {
return false;
}
return slideList.some(function (item) {
return item && Number(item.id) === Number(slide.id);
});
}
// Skip the current slide when an RTMP feed is unavailable and the playlist asks for it.
function handleRtmpPlaybackFailure(message, options) {
if (!currentPlaylistSkipUnavailableRtmp) {
@@ -165,6 +175,7 @@ function refresh() {
const data = JSON.parse(request.responseText || '{}');
const nextSignature = getPlaylistRevision(data);
const nextSlides = Array.isArray(data.slides) ? data.slides.map(normalizeSlide) : [];
const nextActiveSlides = getActiveSlidesFrom(nextSlides);
const nextFadeBetweenSlides = Boolean(data && data.playlist && data.playlist.fade_between_slides);
const nextSkipUnavailableRtmp = Boolean(data && data.playlist && data.playlist.skip_unavailable_rtmp);
savePlaylistSnapshot({
@@ -196,17 +207,22 @@ function refresh() {
}
return;
}
syncWebpagePreloads(getActiveSlidesFrom(nextSlides), index);
syncWebpagePreloads(nextActiveSlides, index);
if (typeof syncRtmpWarmups === 'function') {
syncRtmpWarmups(getActiveSlidesFrom(nextSlides), index);
syncRtmpWarmups(nextActiveSlides, index);
}
if (currentActiveSlides.length < 2) {
if (nextActiveSlides.length < 2) {
pendingPlaylistUpdate = {
slides: nextSlides,
signature: nextSignature,
fadeBetweenSlides: nextFadeBetweenSlides,
skipUnavailableRtmp: nextSkipUnavailableRtmp
};
if (!isSlideInList(lastRenderedSlide, nextSlides)) {
applyPendingPlaylistUpdate();
showCurrent();
return;
}
logDebug('Playlist update detected; applying on next slide transition.');
return;
}
+1 -1
View File
@@ -61,7 +61,7 @@ async function networkFirst(request, cacheName, cacheKeyRequest) {
if (cached) {
return cached;
}
throw _error;
return new Response('', { status: 504, statusText: 'Offline' });
}
}