diff --git a/trailer.html b/trailer.html index 15b073b..b2f482e 100644 --- a/trailer.html +++ b/trailer.html @@ -179,6 +179,16 @@ return s.writing || s.drawing || s.filming; }); } + // Preparing the storyboard audio is work too. Without this the page stops + // polling and the progress sits at whatever it last happened to see. + function busyReel() { + var st = String(PKG.reel_state || ""); + if (!st || st === "ready" || /^failed/.test(st)) return false; + var t = Date.parse(PKG.reel_started || ""); + if (!t) return true; + return (Date.now() - t) < 15 * 60 * 1000; // older than that is gone + } + async function load() { var r = await api("run_status", { run_id: runId }); if (!r.ok) { showMsg("msg", r.error || "Could not load that run."); return; } @@ -194,7 +204,7 @@ } function tick() { - var busy = DRAFTS.some(busyDraft) || busyRun() || busyShots(); + var busy = DRAFTS.some(busyDraft) || busyRun() || busyShots() || busyReel(); if (busy && !timer) timer = setInterval(refresh, 5000); if (!busy && timer) { clearInterval(timer); timer = null; } }