mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-29 01:05:37 +00:00
fix(export): preserve Pixi fallback after renderer init failure
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
enablePitchPreservingPlayback,
|
||||
getMediaSyncPlaybackRate,
|
||||
} from "@/lib/mediaTiming";
|
||||
import { destroyPixiApplication, initializePixiApplication } from "@/lib/pixiApplicationLifecycle";
|
||||
import {
|
||||
DEFAULT_WALLPAPER_PATH,
|
||||
DEFAULT_WALLPAPER_RELATIVE_PATH,
|
||||
@@ -276,7 +277,7 @@ async function initApplicationWithTimeout(
|
||||
});
|
||||
|
||||
try {
|
||||
await Promise.race([app.init(options), timeoutPromise]);
|
||||
await Promise.race([initializePixiApplication(app, options), timeoutPromise]);
|
||||
} finally {
|
||||
if (timeoutId !== undefined) {
|
||||
clearTimeout(timeoutId);
|
||||
@@ -723,7 +724,10 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
`[VideoPlayback] Failed to init ${backend} renderer (${statusMessage}) after ${elapsed}ms; trying fallback.`,
|
||||
error,
|
||||
);
|
||||
rendererApp.destroy(true);
|
||||
destroyPixiApplication(
|
||||
rendererApp,
|
||||
`${backend} preview renderer initialization`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2127,11 +2131,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
app.ticker.maxFPS = 60;
|
||||
|
||||
if (!mounted) {
|
||||
app.destroy(true, {
|
||||
children: true,
|
||||
texture: false,
|
||||
textureSource: false,
|
||||
});
|
||||
destroyPixiApplication(app, "unmounted preview renderer");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2227,13 +2227,7 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
motionBlurFilterRef.current?.destroy();
|
||||
zoomBlurFilterRef.current = null;
|
||||
motionBlurFilterRef.current = null;
|
||||
if (app && app.renderer) {
|
||||
app.destroy(true, {
|
||||
children: true,
|
||||
texture: false,
|
||||
textureSource: false,
|
||||
});
|
||||
}
|
||||
destroyPixiApplication(app, "preview renderer");
|
||||
appRef.current = null;
|
||||
cameraContainerRef.current = null;
|
||||
videoEffectsContainerRef.current = null;
|
||||
|
||||
Reference in New Issue
Block a user