Replit built a video rendering engine that captures arbitrary web pages as deterministic MP4 videos by virtualizing browser time. The system injects a ~1,200-line JavaScript shim that replaces setTimeout, setInterval, requestAnimationFrame, Date, and performance.now() with a fake clock that advances only when the renderer says

9m read timeFrom blog.replit.com
Post cover image
Table of contents
The Problem: Browsers Don't Want to Be CamerasWhy Not Remotion?Freezing Time: The Virtual ClockThe Compositor Warmup Problem (Or: Why We Render Invisible Frames)The <video> Element Saga: A Five-Layer WorkaroundAudio: Wiretapping the Web Audio APIDeterminism Is a Full-Time JobStanding on Shoulders: WebVideoCreator

Sort: