diff --git a/packages/producer/src/services/htmlCompiler.ts b/packages/producer/src/services/htmlCompiler.ts index 0f3c8efb4..cbe5e59a6 100644 --- a/packages/producer/src/services/htmlCompiler.ts +++ b/packages/producer/src/services/htmlCompiler.ts @@ -633,7 +633,10 @@ function ensureFullDocument(html: string): string { if (/^\n\n\n \n\n\n${html}\n\n`; + // Wrap fragment with a proper document including margin/padding reset. + // Without this, Chrome applies default body { margin: 8px } which creates + // visible white lines at the edges of rendered video. + return `\n\n\n \n \n\n\n${html}\n\n`; } /**