mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user