mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 14:55:37 +00:00
fix: address follow-up capture review
This commit is contained in:
@@ -428,9 +428,15 @@ func mouseInteractionCallback(
|
||||
action = "mouseup"
|
||||
button = 2
|
||||
case .otherMouseDown:
|
||||
guard event.getIntegerValueField(.mouseEventButtonNumber) == 2 else {
|
||||
return Unmanaged.passUnretained(event)
|
||||
}
|
||||
action = "mousedown"
|
||||
button = 3
|
||||
case .otherMouseUp:
|
||||
guard event.getIntegerValueField(.mouseEventButtonNumber) == 2 else {
|
||||
return Unmanaged.passUnretained(event)
|
||||
}
|
||||
action = "mouseup"
|
||||
button = 3
|
||||
default:
|
||||
|
||||
@@ -653,19 +653,27 @@ final class ScreenCaptureRecorder: NSObject, SCStreamOutput, SCStreamDelegate {
|
||||
if Task.isCancelled { return }
|
||||
guard self.isRecording else { return }
|
||||
|
||||
let availableContent: SCShareableContent
|
||||
do {
|
||||
let availableContent = try await SCShareableContent.excludingDesktopWindows(false, onScreenWindowsOnly: true)
|
||||
let windowStillAvailable = availableContent.windows.contains(where: { $0.windowID == trackedWindowId })
|
||||
if !windowStillAvailable {
|
||||
print("WINDOW_UNAVAILABLE")
|
||||
fflush(stdout)
|
||||
availableContent = try await SCShareableContent.excludingDesktopWindows(false, onScreenWindowsOnly: true)
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
|
||||
let windowStillAvailable = availableContent.windows.contains(where: { $0.windowID == trackedWindowId })
|
||||
if !windowStillAvailable {
|
||||
print("WINDOW_UNAVAILABLE")
|
||||
fflush(stdout)
|
||||
do {
|
||||
let outputPath = try await self.finishCapture()
|
||||
print("Recording stopped. Output path: \(outputPath)")
|
||||
fflush(stdout)
|
||||
exit(0)
|
||||
} catch {
|
||||
fputs("Error stopping capture: \(error.localizedDescription)\n", stderr)
|
||||
fflush(stderr)
|
||||
exit(1)
|
||||
}
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -903,6 +903,7 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
|
||||
webcamStopPromise.current = null;
|
||||
pendingWebcamPathPromise.current = null;
|
||||
resolvedWebcamPath.current = result ?? null;
|
||||
webcamRecorder.current = null;
|
||||
return result ?? null;
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user