Bump
All checks were successful
Build and Release / build-and-release (push) Successful in 12m44s

This commit is contained in:
Bryan1029384756
2026-04-18 17:30:53 -05:00
parent 593eaba82e
commit 43cfbe65f3
22 changed files with 1244 additions and 36 deletions

View File

@@ -36,6 +36,12 @@ const DEFAULT_SETTINGS = {
let mainWindow = null;
// Screen-share source picked by the renderer right before LiveKit's
// setScreenShareEnabled(true) call triggers getDisplayMedia. The
// setDisplayMediaRequestHandler reads + clears this on each fire,
// then resolves the callback with the matching DesktopCapturerSource.
let pendingScreenSourceSelection = null;
// ───────────────────────────────────────────────────────────────
// Voice recording — per-participant audio capture
// ───────────────────────────────────────────────────────────────
@@ -187,6 +193,34 @@ function createWindow() {
});
}
// Electron 20+ refuses navigator.mediaDevices.getDisplayMedia()
// unless a handler is registered here. LiveKit's
// setScreenShareEnabled(true) hits getDisplayMedia internally,
// so without this the renderer sees "NotSupportedError: Not
// supported". The renderer pre-stashes its picked source via the
// `screen-share:set-pending-source` IPC, then triggers the LiveKit
// call — we read + clear the pending selection here.
mainWindow.webContents.session.setDisplayMediaRequestHandler(async (_request, callback) => {
const pending = pendingScreenSourceSelection;
pendingScreenSourceSelection = null;
if (!pending) {
callback({});
return;
}
try {
const { desktopCapturer } = require('electron');
const sources = await desktopCapturer.getSources({ types: ['window', 'screen'] });
const source = sources.find(s => s.id === pending.sourceId);
if (!source) { callback({}); return; }
callback({
video: source,
audio: pending.includeAudio ? 'loopback' : undefined,
});
} catch {
callback({});
}
}, { useSystemPicker: false });
if (settings.isMaximized) {
mainWindow.maximize();
}
@@ -634,6 +668,13 @@ app.whenReady().then(async () => {
}));
});
ipcMain.handle('screen-share:set-pending-source', (_event, payload) => {
pendingScreenSourceSelection = payload && typeof payload.sourceId === 'string'
? { sourceId: payload.sourceId, includeAudio: !!payload.includeAudio }
: null;
return true;
});
// Crypto Handlers
const crypto = require('crypto');