mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 23:05:49 +00:00
fix: don't let webcam teardown block native stop IPC
Start webcam stop as a guarded promise so a rejection can't prevent stopNativeScreenRecording from running. The webcam result is awaited only after the native stop path completes.
This commit is contained in:
@@ -26,7 +26,10 @@ export async function stopNativeRecordingSession(options: StopRecordingOptions)
|
||||
options.showRecordingFinalizationToast();
|
||||
|
||||
const micFallbackBlobPromise = stopMicFallbackRecorder(options.refs);
|
||||
const webcamPath = await stopWebcamRecorder(options.refs);
|
||||
const webcamPathPromise = stopWebcamRecorder(options.refs).catch((error) => {
|
||||
console.warn("Failed to stop webcam recorder:", error);
|
||||
return null;
|
||||
});
|
||||
const isNativeWindows = options.refs.nativeWindowsRecording.current;
|
||||
options.markRecordingResumed(Date.now());
|
||||
const pauseSegments = options.refs.pauseSegmentsRef.current.slice();
|
||||
@@ -82,6 +85,7 @@ export async function stopNativeRecordingSession(options: StopRecordingOptions)
|
||||
finalPath = muxResult?.path ?? result.path;
|
||||
}
|
||||
|
||||
const webcamPath = await webcamPathPromise;
|
||||
await options.storeMicrophoneSidecar(micFallbackBlobPromise, finalPath);
|
||||
await options.finalizeRecordingSession(finalPath, webcamPath);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user