mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-09 03:16:38 +00:00
fix(render): avoid empty WAAPI scans and llvmpipe auto GPU (#1775)
Avoid the screenshot-path #1715 regression by skipping empty WAAPI/CSS animation scans per seek and classifying known software WebGL renderers correctly in browserGpuMode=auto.\n\nAddresses #1715.
This commit is contained in:
@@ -8,6 +8,7 @@ export function createCssAdapter(params?: {
|
||||
el: HTMLElement;
|
||||
baseDelay: string;
|
||||
basePlayState: string;
|
||||
animations: Animation[];
|
||||
}> = [];
|
||||
|
||||
const getAnimationsForElement = (el: HTMLElement): Animation[] => {
|
||||
@@ -84,6 +85,7 @@ export function createCssAdapter(params?: {
|
||||
el: rawEl,
|
||||
baseDelay: rawEl.style.animationDelay || "",
|
||||
basePlayState: rawEl.style.animationPlayState || "",
|
||||
animations: getAnimationsForElement(rawEl),
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -95,7 +97,7 @@ export function createCssAdapter(params?: {
|
||||
? params.resolveStartSeconds(entry.el)
|
||||
: Number.parseFloat(entry.el.getAttribute("data-start") ?? "0") || 0;
|
||||
const localTimeMs = Math.max(0, time - start) * 1000;
|
||||
const animations = getAnimationsForElement(entry.el);
|
||||
const animations = entry.animations;
|
||||
if (animations.length > 0) {
|
||||
seekAnimations(animations, localTimeMs);
|
||||
continue;
|
||||
@@ -109,7 +111,7 @@ export function createCssAdapter(params?: {
|
||||
pause: () => {
|
||||
for (const entry of entries) {
|
||||
if (!entry.el.isConnected) continue;
|
||||
const animations = getAnimationsForElement(entry.el);
|
||||
const animations = entry.animations;
|
||||
if (animations.length > 0) {
|
||||
pauseAnimations(animations);
|
||||
}
|
||||
@@ -120,7 +122,7 @@ export function createCssAdapter(params?: {
|
||||
for (const entry of entries) {
|
||||
if (!entry.el.isConnected) continue;
|
||||
restoreInlineStyles(entry);
|
||||
playAnimations(getAnimationsForElement(entry.el));
|
||||
playAnimations(entry.animations);
|
||||
}
|
||||
},
|
||||
revert: () => {
|
||||
|
||||
Reference in New Issue
Block a user