Replit — We Built a Video Rendering Engine by Lying to the Browser About What Time It Is
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
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
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: WebVideoCreatorSort: