Improve videos

This commit is contained in:
Andras Schmelczer 2026-06-10 21:28:19 +01:00
parent 4012e4e047
commit d3418c67cc
11 changed files with 988 additions and 869 deletions

View file

@ -29,16 +29,30 @@ export async function prepareTimeline(
await sleep(400);
await installZoomWrapper(page);
await installCursor(page);
await installCursor(page, storyboard.video.cursorStyle ?? 'arrow');
await setAspectClass(page, storyboard.video.aspect);
const ctx: ScriptCtx = { page, dashboard, cursor: { x: 200, y: 240 } };
await page.mouse.move(ctx.cursor.x, ctx.cursor.y);
await prepareAiBox(ctx);
// Only pre-open the AI prompt when the storyboard actually types into it.
// Opening it unconditionally grows the mobile bottom sheet (keyboard
// avoidance) and steals the frame from the map on ads that never type.
if (storyboardTypes(storyboard)) {
await prepareAiBox(ctx);
}
await sleep(80);
return ctx;
}
function storyboardTypes(storyboard: Storyboard): boolean {
const all = [
...(storyboard.pre ?? []),
...storyboard.cues.flatMap((cue) => [...(cue.during ?? []), ...(cue.tail ?? [])]),
...(storyboard.post ?? []),
];
return all.some((activity) => activity.kind === 'type');
}
export async function runTimeline(
ctx: ScriptCtx,
storyboard: Storyboard