mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-13 13:53:12 -06:00
Show the idle card on a group-synced screen when nothing is scheduled
Give every item on a sync-group playlist a daypart — "menu boards 06:00-22:00" — and at 22:00 the whole group kept displaying, or looping, whatever had been in-window last. An identical ungrouped screen showed "Nothing scheduled right now" correctly. The group schedule tick filters items by the same scheduleAllows check as solo playback. With everything filtered out the period is zero, so the target is null and the tick simply returned. Nothing else was watching: group members are schedule-driven, so renderContent arms no advanceTimer, and a group-rendered video is created with loop = !!groupSync. Solo playback routes this exact condition into the idle card; group playback had no equivalent, on either player. Both ticks now tear down and show the idle card when the schedule has nothing live, and pick up again when the daypart re-opens. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL
This commit is contained in:
parent
47bda040a2
commit
9458af95fd
|
|
@ -1720,7 +1720,19 @@
|
|||
function groupScheduleTick() {
|
||||
if (!groupSync || playlist.length === 0) return;
|
||||
const t = groupScheduleTarget();
|
||||
if (!t) return;
|
||||
if (!t) {
|
||||
// period === 0 means every item is currently outside its daypart. Solo playback routes the
|
||||
// same condition into showNothingScheduled(); group playback just returned, so nothing was
|
||||
// watching — group members are scheduleDriven, so renderContent arms no advanceTimer, and
|
||||
// a group-rendered video is created with loop = !!groupSync. Out of hours the whole group
|
||||
// therefore kept displaying (or looping) whatever had been in-window last, while an
|
||||
// identical ungrouped screen correctly showed the idle card.
|
||||
if (isPlaying) {
|
||||
teardownCurrentMedia();
|
||||
showNothingScheduled();
|
||||
}
|
||||
return;
|
||||
}
|
||||
// Double buffer: warm the next clip ~6s before the boundary (once per boundary).
|
||||
if (t.nextIndex !== t.index && t.secToBoundary >= 0 && t.secToBoundary <= 6 && groupPreloadIdx !== t.nextIndex) {
|
||||
groupPreloadNext(t.nextIndex);
|
||||
|
|
|
|||
|
|
@ -1323,7 +1323,15 @@ GroupSyncController.prototype.target = function () {
|
|||
};
|
||||
GroupSyncController.prototype.tick = function () {
|
||||
if (!this.groupId || !this.player.items.length) return;
|
||||
var t = this.target(); if (!t) return;
|
||||
// No target means every item is currently outside its daypart. Returning here left the whole
|
||||
// group displaying (or looping) whatever was in-window last, out of hours — while an identical
|
||||
// ungrouped screen correctly showed the idle card. Group members are schedule-driven, so no
|
||||
// renderer arms a timer and nothing else was watching for this.
|
||||
var t = this.target();
|
||||
if (!t) {
|
||||
if (this.player.hasContentOnScreen()) this.player.nothingScheduled();
|
||||
return;
|
||||
}
|
||||
// Double buffer: warm the next clip ~6s before the boundary (once per boundary).
|
||||
if (t.nextIndex !== t.index && t.secToBoundary >= 0 && t.secToBoundary <= 6) {
|
||||
this.player.preloadVideo(t.nextIndex); // warm next clip (video-only; no-ops otherwise)
|
||||
|
|
|
|||
Loading…
Reference in a new issue