fix: speed up video frame injection renders (#596)

This commit is contained in:
Miguel Ángel
2026-05-02 05:11:05 +02:00
committed by GitHub
parent 04bd56a7ae
commit 4750a981dd
5 changed files with 236 additions and 101 deletions
@@ -446,13 +446,15 @@ export async function injectVideoFramesBatch(
}
}
img.decoding = "sync";
img.src = item.dataUri;
pendingDecodes.push(
img
.decode()
.catch(() => undefined)
.then(() => undefined),
);
if (img.getAttribute("src") !== item.dataUri) {
img.src = item.dataUri;
pendingDecodes.push(
img
.decode()
.catch(() => undefined)
.then(() => undefined),
);
}
img.style.opacity = String(computedOpacity);
img.style.visibility = "visible";
// Hide the native <video> with visibility only — never clobber inline