Enable screensharing in desktop app (#2042)
* enable screensharing in desktop app * add source picker * update dependencies * improve source picker * improve source picker * update thumbnails * decrease thumbnail size * revert unnecessary changes in screen sharing store * fix types and eslint * fix prettier * remove unused import
This commit is contained in:
@@ -8,6 +8,7 @@ const api: WorkAdventureDesktopApi = {
|
||||
notify: (txt) => ipcRenderer.send("app:notify", txt),
|
||||
onMuteToggle: (callback) => ipcRenderer.on("app:on-mute-toggle", callback),
|
||||
onCameraToggle: (callback) => ipcRenderer.on("app:on-camera-toggle", callback),
|
||||
getDesktopCapturerSources: (options) => ipcRenderer.invoke("app:getDesktopCapturerSources", options),
|
||||
};
|
||||
|
||||
contextBridge.exposeInMainWorld("WAD", api);
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
// copy of Electron.SourcesOptions to avoid Electron dependency in front
|
||||
export interface SourcesOptions {
|
||||
types: string[];
|
||||
thumbnailSize?: { height: number; width: number };
|
||||
}
|
||||
|
||||
export interface DesktopCapturerSource {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnailURL: string;
|
||||
}
|
||||
|
||||
export type WorkAdventureDesktopApi = {
|
||||
desktop: boolean;
|
||||
isDevelopment: () => Promise<boolean>;
|
||||
@@ -5,4 +17,5 @@ export type WorkAdventureDesktopApi = {
|
||||
notify: (txt: string) => void;
|
||||
onMuteToggle: (callback: () => void) => void;
|
||||
onCameraToggle: (callback: () => void) => void;
|
||||
getDesktopCapturerSources: (options: SourcesOptions) => Promise<DesktopCapturerSource[]>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user