From 796aeff168d1e581332f53c002734b01392bfedd Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 12 Jul 2022 08:23:53 -0400 Subject: [PATCH] Hide screenshare button in video rooms on Desktop (#22810) * Hide screenshare button in video rooms on Desktop * Splice the screensharing button into the array --- src/vector/jitsi/index.ts | 12 +++++++++--- src/vector/platform/ElectronPlatform.tsx | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 969ce9e5ed..1b3e1aa34a 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -52,6 +52,7 @@ let openIdToken: IOpenIDCredentials; let roomName: string; let startAudioOnly: boolean; let isVideoChannel: boolean; +let supportsScreensharing: boolean; let widgetApi: WidgetApi; let meetApi: any; // JitsiMeetExternalAPI @@ -122,6 +123,7 @@ const ack = (ev: CustomEvent) => widgetApi.transport.reply(ev roomName = qsParam('roomName', true); startAudioOnly = qsParam('isAudioOnly', true) === "true"; isVideoChannel = qsParam('isVideoChannel', true) === "true"; + supportsScreensharing = qsParam('supportsScreensharing', true) === "true"; // We've reached the point where we have to wait for the config, so do that then parse it. const instanceConfig = new SnakedObject((await configPromise) ?? {}); @@ -408,9 +410,13 @@ function joinConference(audioDevice?: string | null, videoDevice?: string | null // deployments that have it enabled options.configOverwrite.prejoinConfig = { enabled: false }; // Use a simplified set of toolbar buttons - options.configOverwrite.toolbarButtons = [ - "microphone", "camera", "desktop", "tileview", "hangup", - ]; + options.configOverwrite.toolbarButtons = ["microphone", "camera", "tileview", "hangup"]; + // Note: We can hide the screenshare button in video rooms but not in + // normal conference calls, since in video rooms we control exactly what + // set of controls appear, but in normal calls we need to leave that up + // to the deployment's configuration. + // https://github.com/vector-im/element-web/issues/4880#issuecomment-940002464 + if (supportsScreensharing) options.configOverwrite.toolbarButtons.splice(2, 0, "desktop"); // Hide all top bar elements options.configOverwrite.conferenceInfo = { autoHide: [] }; // Remove the ability to hide your own tile, since we're hiding the diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index ee26b35f06..b2aaa935a1 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -324,6 +324,11 @@ export default class ElectronPlatform extends VectorBasePlatform { return true; } + public supportsJitsiScreensharing(): boolean { + // See https://github.com/vector-im/element-web/issues/4880 + return false; + } + public async getAvailableSpellCheckLanguages(): Promise { return this.ipc.call('getAvailableSpellCheckLanguages'); }