mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-25 07:16:02 +00:00
fix(recording): preserve mic audio when recovering mac capture
This commit is contained in:
@@ -2651,25 +2651,32 @@ async function finalizeStoredVideo(videoPath: string) {
|
||||
}
|
||||
|
||||
async function recoverNativeMacCaptureOutput() {
|
||||
const diagnosticsPath =
|
||||
const macDiagnostics =
|
||||
lastNativeCaptureDiagnostics?.backend === 'mac-screencapturekit'
|
||||
? lastNativeCaptureDiagnostics.outputPath ?? null
|
||||
? lastNativeCaptureDiagnostics
|
||||
: null
|
||||
const diagnosticsPath = macDiagnostics?.outputPath ?? null
|
||||
const candidatePath = nativeCaptureTargetPath ?? diagnosticsPath
|
||||
const systemAudioPath = nativeCaptureSystemAudioPath ?? macDiagnostics?.systemAudioPath ?? null
|
||||
const microphonePath = nativeCaptureMicrophonePath ?? macDiagnostics?.microphonePath ?? null
|
||||
|
||||
if (!candidatePath) {
|
||||
return null
|
||||
}
|
||||
|
||||
try {
|
||||
if (systemAudioPath || microphonePath) {
|
||||
await muxNativeMacRecordingWithAudio(candidatePath, systemAudioPath, microphonePath)
|
||||
}
|
||||
|
||||
return await finalizeStoredVideo(candidatePath)
|
||||
} catch (error) {
|
||||
recordNativeCaptureDiagnostics({
|
||||
backend: 'mac-screencapturekit',
|
||||
phase: 'stop',
|
||||
outputPath: candidatePath,
|
||||
systemAudioPath: nativeCaptureSystemAudioPath,
|
||||
microphonePath: nativeCaptureMicrophonePath,
|
||||
systemAudioPath,
|
||||
microphonePath,
|
||||
processOutput: nativeCaptureOutputBuffer.trim() || undefined,
|
||||
fileSizeBytes: await getFileSizeIfPresent(candidatePath),
|
||||
error: String(error),
|
||||
@@ -4899,4 +4906,3 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user