mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 00:56:23 +00:00
fix: address review feedback — observability, dedup, query-strip, catalog
Review items addressed: 1. Mirror video-failure warning in beginFrame path (was screenshot-only) 2. Fix resolveProjectRelativeSrc escape-fallback to use query-stripped cleanSrc instead of raw src for the normalize/strip arm 3. Export prepareFlattenedInnerRoot from @hyperframes/core/compiler and consume in the producer instead of duplicating the implementation 4. Use typed Window cast instead of (window as any) for __hfForceTimelineRebind 5. Regenerate docs/public/catalog-index.json with all 6 map blocks 6. Restore Maps nav group in docs.json (catalog generator had merged them into Data)
This commit is contained in:
@@ -682,11 +682,25 @@ export async function initializeSession(session: CaptureSession): Promise<void>
|
||||
await applyVideoMetadataHints(page, session.options.videoMetadataHints);
|
||||
|
||||
// Same readyState contract as the screenshot path above (>= 2 / HAVE_CURRENT_DATA).
|
||||
await pollVideosReady(
|
||||
const bfVideosReady = await pollVideosReady(
|
||||
page,
|
||||
session.options.skipReadinessVideoIds ?? [],
|
||||
session.config?.playerReadyTimeout ?? DEFAULT_CONFIG.playerReadyTimeout,
|
||||
);
|
||||
if (!bfVideosReady) {
|
||||
const failedVideos = await page.evaluate((skipIdList: readonly string[]) => {
|
||||
const skip = new Set(skipIdList);
|
||||
return Array.from(document.querySelectorAll("video"))
|
||||
.filter((v) => !skip.has(v.id))
|
||||
.filter((v) => (v as HTMLVideoElement).readyState < 2 && !(v as HTMLVideoElement).error)
|
||||
.map((v) => (v as HTMLVideoElement).src || v.getAttribute("src") || "(no src)")
|
||||
.join(", ");
|
||||
}, session.options.skipReadinessVideoIds ?? []);
|
||||
console.warn(
|
||||
`[FrameCapture] Some video elements did not decode within ${pageReadyTimeout}ms: ${failedVideos}. ` +
|
||||
`Continuing render — affected videos will appear as blank/black frames.`,
|
||||
);
|
||||
}
|
||||
|
||||
// Font check (no rAF dependency — uses fonts.ready API directly)
|
||||
await page.evaluate(`document.fonts?.ready`);
|
||||
|
||||
@@ -530,7 +530,7 @@ export function resolveProjectRelativeSrc(
|
||||
// then strip any remaining leading `..` segments. Stripping `..` from the
|
||||
// raw input would leave dangling siblings (`assets/../../assets/foo`
|
||||
// would become `assets/assets/foo` instead of `assets/foo`).
|
||||
const normalized = posix.normalize(src.replace(/\\/g, "/"));
|
||||
const normalized = posix.normalize(cleanSrc.replace(/\\/g, "/"));
|
||||
const stripped = normalized.replace(/^(\.\.\/)+/, "");
|
||||
if (stripped && stripped !== src && !stripped.startsWith("..")) {
|
||||
if (compiledDir) candidates.push(join(compiledDir, stripped));
|
||||
|
||||
Reference in New Issue
Block a user