fix(producer): strip embedded runtime before render-mode detection

detectRenderModeHints scanned the raw HTML including the embedded
HyperFrames runtime script, which contains requestAnimationFrame.
This false positive forced screenshot capture mode for compositions
that don't use rAF themselves, degrading video frame injection.

Strip embedded runtime scripts before analyzing render mode hints
so only user-authored code is inspected.
This commit is contained in:
Miguel Ángel
2026-05-23 12:56:37 -04:00
parent 3560678bb2
commit 280a0780a1
@@ -21,7 +21,7 @@ import {
type ResolvedDuration,
type UnresolvedElement,
} from "@hyperframes/core";
import { inlineSubCompositions as inlineSubCompositionsShared } from "@hyperframes/core/compiler";
import { inlineSubCompositions as inlineSubCompositionsShared, stripEmbeddedRuntimeScripts } from "@hyperframes/core/compiler";
import { extractMediaMetadata, extractAudioMetadata } from "../utils/ffprobe.js";
import { isPathInside, toExternalAssetKey } from "../utils/paths.js";
import {
@@ -933,8 +933,9 @@ export async function compileForRender(
/(<(?:video|audio)\b[^>]*?)\s+preload\s*=\s*["']none["']/gi,
"$1",
);
const renderModeHints = detectRenderModeHints(sanitizedHtml);
const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
const htmlForAnalysis = stripEmbeddedRuntimeScripts(sanitizedHtml);
const renderModeHints = detectRenderModeHints(htmlForAnalysis);
const hasShaderTransitions = detectShaderTransitionUsage(htmlForAnalysis);
const coalescedHtml = await injectDeterministicFontFaces(
injectTextRenderingRule(