Switch to the new session API for screen-sharing

See https://github.com/electron/electron/pull/30702 - this has the benefit of the js-sdk and LiveKit not having to add custom logic for Electron

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2023-07-14 12:09:12 +02:00
parent 4e69dda7d2
commit a21e5afb84
4 changed files with 43 additions and 1 deletions
+6
View File
@@ -22,6 +22,7 @@ import { recordSSOSession } from "./protocol";
import { randomArray } from "./utils";
import { Settings } from "./settings";
import { keytar } from "./keytar";
import { getDisplayMediaCallback, setDisplayMediaCallback } from "./displayMediaCallback";
ipcMain.on("setBadgeCount", function (_ev: IpcMainEvent, count: number): void {
if (process.platform !== "win32") {
@@ -186,6 +187,11 @@ ipcMain.on("ipcCall", async function (_ev: IpcMainEvent, payload) {
thumbnailURL: source.thumbnail.toDataURL(),
}));
break;
case "callDisplayMediaCallback":
await getDisplayMediaCallback()?.({ video: args[0] });
setDisplayMediaCallback(null);
ret = null;
break;
case "clearStorage":
global.store.clear();