From f3cfb15d51c7d0ef40b55b789aa1028f9f900a17 Mon Sep 17 00:00:00 2001 From: gator Date: Thu, 17 Sep 2026 18:24:46 +0000 Subject: [PATCH] Play automatically when preparation finishes, and stop implying failure "Prepare and play" only prepared. And a shot with no dialogue has no audio by design, so 13 of 20 spoken is not 7 failures - say how many are silent. --- trailer.html | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/trailer.html b/trailer.html index b2f482e..12cb369 100644 --- a/trailer.html +++ b/trailer.html @@ -162,6 +162,7 @@ var RUN = null, DRAFTS = [], CUR = null, PKG = {}, NOTES = {}, REVIEWS = []; var timer = null, EDITING = null; var PLAYING = null, STATS = {}, QUEUE = [], QAT = 0; + var REELWANT = false; // the author asked to play, not merely to prepare var runId = new URLSearchParams(location.search).get("run") || ""; var audio = new Audio(); @@ -490,8 +491,18 @@ if (running) out += '

Speaking every shot… ' + esc(st) + '

'; + else if (st === "ready") { + var spoken = shots.filter(function (s) { return s.reel_url; }).length; + var silent = shots.length - spoken; + out += '

' + spoken + ' shots have dialogue and are spoken' + + (silent ? '; ' + silent + ' are silent and hold on the frame' : '') + + '.

'; + } else if (/^failed/.test(st)) out += '

' + esc(st) + '

'; + else if (st) + out += '

The last attempt stopped before it finished — ' + + 'the server restarted under it. Ask again.

'; if (!REEL) { out += '
' @@ -880,12 +891,15 @@ el.disabled = true; var rl = await api("reel", { draft_id: CUR }); if (!rl.ok) { showMsg("msg", rl.error || "Could not load the storyboard."); return; } - if (rl.ready < rl.of) { + if (String(PKG.reel_state || "") !== "ready") { el.textContent = "Speaking every shot…"; + REELWANT = true; r = await act("prepare_reel", { draft_id: CUR }); if (r) showMsg("msg", "Speaking " + r.shots + " shots. This is the same " - + "audio the film will use, so it is only paid for once.", "ok"); - setTimeout(refresh, 15000); + + "audio the film will use, so it is only paid for once. It starts " + + "playing on its own when it is ready.", "ok"); + else REELWANT = false; + await refresh(); return; } hideMsg("msg");