Hide screenshare button in video rooms on Desktop (#22810)

* Hide screenshare button in video rooms on Desktop

* Splice the screensharing button into the array
This commit is contained in:
Robin 2022-07-12 08:23:53 -04:00 committed by GitHub
parent a271516c8b
commit 796aeff168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -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<IWidgetApiRequest>) => 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<IConfigOptions>((await configPromise) ?? <IConfigOptions>{});
@ -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

View File

@ -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<string[]> {
return this.ipc.call('getAvailableSpellCheckLanguages');
}