mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 14:55:37 +00:00
fix(windows): address PR 517 review feedback
This commit is contained in:
@@ -55,6 +55,7 @@ public class MonitorHelper {
|
||||
|
||||
const result = spawnSync("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", psScript], {
|
||||
encoding: "utf-8",
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
if (result.error || result.status !== 0) {
|
||||
|
||||
@@ -75,7 +75,6 @@ import {
|
||||
waitForWindowsCaptureStart,
|
||||
waitForWindowsCaptureStop,
|
||||
} from "../recording/windows";
|
||||
import { getMonitorHandles } from "../monitorResolver";
|
||||
import {
|
||||
shouldStartWindowsBrowserMicrophoneFallback,
|
||||
shouldUseWindowsBrowserMicrophoneFallback,
|
||||
@@ -439,10 +438,11 @@ export function registerRecordingHandlers(
|
||||
// Windows Graphics Capture (WGC) requires a raw HMONITOR handle.
|
||||
// We attempt to resolve the handle by matching the physical coordinates of the target display.
|
||||
const monitors = getMonitorHandles();
|
||||
const matchedMonitor = monitors.find(m =>
|
||||
m.x === Math.round(displayBounds.x) &&
|
||||
m.y === Math.round(displayBounds.y)
|
||||
) || monitors[0];
|
||||
const matchedMonitor = monitors.find(
|
||||
(monitor) =>
|
||||
monitor.x === Math.round(displayBounds.x) &&
|
||||
monitor.y === Math.round(displayBounds.y),
|
||||
);
|
||||
|
||||
if (matchedMonitor) {
|
||||
config.displayId = matchedMonitor.handle;
|
||||
@@ -466,6 +466,8 @@ export function registerRecordingHandlers(
|
||||
config.captureSystemAudio = true;
|
||||
config.audioOutputPath = tempAudioPath;
|
||||
setWindowsSystemAudioPath(systemAudioPath);
|
||||
} else {
|
||||
setWindowsSystemAudioPath(null);
|
||||
}
|
||||
|
||||
if (options?.capturesMicrophone && !browserMicFallbackRequested) {
|
||||
@@ -480,6 +482,8 @@ export function registerRecordingHandlers(
|
||||
} else if (browserMicFallbackRequested) {
|
||||
config.captureMic = false;
|
||||
setWindowsMicAudioPath(null);
|
||||
} else {
|
||||
setWindowsMicAudioPath(null);
|
||||
}
|
||||
|
||||
recordNativeCaptureDiagnostics({
|
||||
@@ -574,6 +578,9 @@ export function registerRecordingHandlers(
|
||||
setNativeScreenRecordingActive(false);
|
||||
setWindowsCaptureProcess(null);
|
||||
setWindowsCaptureTargetPath(null);
|
||||
setWindowsSystemAudioPath(null);
|
||||
setWindowsMicAudioPath(null);
|
||||
setWindowsOrphanedMicAudioPath(null);
|
||||
setWindowsCaptureStopRequested(false);
|
||||
setWindowsCapturePaused(false);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user