fix: avoid ScreenCaptureKit launch crash on macOS 11 (#424)

Co-authored-by: txhno <[email protected]>
This commit is contained in:
Roshan Warrier
2026-04-16 01:58:29 -07:00
committed by GitHub
co-authored by txhno
parent 7184a25e44
commit a5d5c780c2
6 changed files with 47 additions and 18 deletions
+18 -2
View File
@@ -26,8 +26,24 @@ export function useSystemAudioCapture({
// Check if system audio capture is supported
useEffect(() => {
const supported = platform.audio.isSystemAudioSupported();
setIsSupported(supported);
let isActive = true;
void platform.audio
.isSystemAudioSupported()
.then((supported) => {
if (isActive) {
setIsSupported(supported);
}
})
.catch(() => {
if (isActive) {
setIsSupported(false);
}
});
return () => {
isActive = false;
};
}, [platform]);
const startRecording = useCallback(async () => {
+1 -1
View File
@@ -42,7 +42,7 @@ export interface AudioDevice {
}
export interface PlatformAudio {
isSystemAudioSupported(): boolean;
isSystemAudioSupported(): Promise<boolean>;
startSystemAudioCapture(maxDurationSecs: number): Promise<void>;
stopSystemAudioCapture(): Promise<Blob>;
listOutputDevices(): Promise<AudioDevice[]>;