only pass partial info
This commit is contained in:
parent
b87bcaefe9
commit
f7b7931847
1 changed files with 6 additions and 6 deletions
|
@ -33,18 +33,18 @@ export function registerScreenShareHandler() {
|
||||||
process.platform === "linux" &&
|
process.platform === "linux" &&
|
||||||
(process.env.XDG_SESSION_TYPE === "wayland" || !!process.env.WAYLAND_DISPLAY);
|
(process.env.XDG_SESSION_TYPE === "wayland" || !!process.env.WAYLAND_DISPLAY);
|
||||||
|
|
||||||
if (isWayland) {
|
|
||||||
const video = sources[0];
|
|
||||||
callback(video ? { video } : {});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = sources.map(({ id, name, thumbnail }) => ({
|
const data = sources.map(({ id, name, thumbnail }) => ({
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
url: thumbnail.toDataURL()
|
url: thumbnail.toDataURL()
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
if (isWayland) {
|
||||||
|
const video = data[0];
|
||||||
|
callback(video ? { video } : {});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const choice = await request.frame
|
const choice = await request.frame
|
||||||
.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
||||||
.then(e => e as StreamPick)
|
.then(e => e as StreamPick)
|
||||||
|
|
Loading…
Reference in a new issue