fix: parsing of window ID was not done. Hence why it couldn't record something other than the entire screen.

This commit is contained in:
Alan Trebugeais
2026-05-09 23:20:13 +02:00
parent 7ec1f8a25f
commit 30c82fcce4
+13 -5
View File
@@ -412,6 +412,9 @@ export function registerRecordingHandlers(
let orphanedMicAudioPath: string | null = null;
const browserMicFallbackRequested =
shouldStartWindowsBrowserMicrophoneFallback(options);
const windowId = parseWindowId(source?.id);
const isWindowCapture = Boolean(windowId && source?.id?.startsWith("window:"));
const resolvedDisplay = resolveWindowsCaptureDisplay(
source,
getScreen().getAllDisplays(),
@@ -423,13 +426,18 @@ export function registerRecordingHandlers(
const config: Record<string, unknown> = {
outputPath,
fps: 60,
displayId: resolvedDisplay.displayId,
displayX: Math.round(resolvedDisplay.bounds.x),
displayY: Math.round(resolvedDisplay.bounds.y),
displayW: Math.round(resolvedDisplay.bounds.width),
displayH: Math.round(resolvedDisplay.bounds.height),
};
if (isWindowCapture) {
config.windowHandle = windowId;
} else {
config.displayId = resolvedDisplay.displayId;
config.displayX = Math.round(resolvedDisplay.bounds.x);
config.displayY = Math.round(resolvedDisplay.bounds.y);
config.displayW = Math.round(resolvedDisplay.bounds.width);
config.displayH = Math.round(resolvedDisplay.bounds.height);
}
if (options?.capturesSystemAudio) {
systemAudioPath = path.join(
recordingsDir,