Skip to content

@remotion/studio: Add defaultPremountInSeconds option - #12054

Merged
JonnyBurger merged 8 commits into
mainfrom
codex/default-premount-in-seconds
Oct 7, 2026
Merged

JonnyBurger merged 8 commits into
mainfrom
codex/default-premount-in-seconds

Conversation

@JonnyBurger

@JonnyBurger JonnyBurger commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Add defaultPremountInSeconds to configure premounting for timed components without an explicit premountFor. Studio exposes the value through Config.setDefaultPremountInSeconds(), --default-premount-in-seconds, and Studio settings; Player exposes it as a prop.

The default is 0 seconds in v4 and 2 seconds in v5. The empty template explicitly sets 2 seconds, including when created in the browser Studio. Explicit premountFor values retain precedence, and rendering is unaffected. This replaces the hardcoded v5 premount duration and avoids applying the default recursively inside the premount wrapper.

Rewrote the premounting guide around direct component props, with a shared explanation for images and animations, default premounting, and preparing whole scenes. The guide also documents premounting entire Series and TransitionSeries containers, including Series' required layout="absolute-fill" setting.

The existing SDK Canvas/vibe-code browser workflow now retries transient DOM detachment while waiting for the timeline bar, then verifies the edited durations and persisted source.

Validation:

  • bun run build
  • bun run stylecheck
  • Existing focused Sequence, Player, media premounting, config reload/reset, and browser Studio template/download tests
  • Focused SDK Canvas/vibe-code Playwright workflow after the test fix
  • Manual checks of Studio save/reset, fractional durations, CLI precedence, Player opt-out, and the v5 default
  • Premounting guide MDX compilation, TypeScript snippet checks, and docs route validation

Preview

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bugs Ready Ready Preview Oct 7, 2026 10:33am UTC
remotion Ready Ready Preview Oct 7, 2026 10:33am UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor suggestion below.

Reviewed changes

  • Default premount context: new DefaultPremountContext + DEFAULT_PREMOUNT_IN_SECONDS (0 in v4, 2 in v5). usePremounting and <Sequence> now resolve the default from context instead of the compile-time v5 fps, so the v5 default also moves from fps (1 s) to 2 s.
  • Recursion fix: PremountedPostmountedSequence renders RegularSequence directly rather than re-entering the dispatch path, so the default is no longer applied a second time inside the premount wrapper.
  • Player: new validated defaultPremountInSeconds prop, threaded through Internals.DefaultPremountContext.
  • Config / CLI: default-premount-in-seconds option wired to Config.setDefaultPremountInSeconds, the remotion studio CLI flag, Studio runtime config, and Studio settings.
  • Docs: v5 migration guide, sequence / series / player / premounting pages, new option page, regenerated option sidebar positions.

ℹ️ Nitpicks

  • No automated tests accompany the new option. The validation in validateDefaultPremountInSeconds (rejects non-numbers, NaN/Infinity, negatives) and the precedence chain (--default-premount-in-seconds → config file → compile-time default) are easy to pin with a focused test next to the existing config-reset/option tests, and would also lock in the premountFor={0} opt-out behavior.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes (incremental — only c11164b since the prior review at d80ebbe)

  • Premounting guide rewrite (packages/docs/docs/player/premounting.mdx): restructured around per-component premountFor, added a component/availability table, a default-premount-duration section (Studio config/CLI/settings plus the Player prop), a <Series>/<TransitionSeries> section, and a buffer-state note.
  • Verified the new behavior claims against the code: <Series layout="absolute-fill" premountFor> and <TransitionSeries premountFor> do forward through TrackWithoutSchema to Sequence, the table's AvailableFrom values match the individual component docs (e.g. media 4.0.495, Img/AnimatedImage/Gif 4.0.497, AbsoluteFill/Lottie/shapes/ThreeCanvas 4.0.528), and static/img/premount.png and the imported Premounting/NoPremounting components exist.
  • sequence.mdx / series.mdx: default text now reads 0 s (v4) / 2 s (v5), consistent with the option and migration guide.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash | 𝕏

@JonnyBurger
JonnyBurger merged commit 308fbf5 into main Oct 7, 2026
31 of 33 checks passed
@JonnyBurger
JonnyBurger deleted the codex/default-premount-in-seconds branch October 7, 2026 10:52

This branch was successfully deployed

2 active deployments
Preview – remotion — 4d23ae01 Deployed Oct 7, 2026 by vercel[bot]
Preview – bugs — 4d23ae01 Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant