From 80a48027f5f2d6ac00055e9352a7d17f82cc67e4 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 9 Oct 2025 12:00:35 +0100 Subject: [PATCH 1/2] Forward calling settings to Element Call. --- src/models/Call.ts | 74 +++++++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/src/models/Call.ts b/src/models/Call.ts index 356aef1f3bc..eac9577dc9d 100644 --- a/src/models/Call.ts +++ b/src/models/Call.ts @@ -661,6 +661,59 @@ export class ElementCall extends Call { } } + /** + * Append parameters specific to the users settings + * @param params Existing URL parameters + */ + private static appendSettingsParams(params: URLSearchParams): void { + const preferredAudioOutput = SettingsStore.getValue("webrtc_audiooutput", null, true); + const preferredAudioInput = SettingsStore.getValue("webrtc_audioinput", null, true); + const videoInput = SettingsStore.getValue("webrtc_videoinput", null, true); + const autoGainControl = SettingsStore.getValue("webrtc_audio_autoGainControl", null, true); + const echoCancellation = SettingsStore.getValue("webrtc_audio_echoCancellation", null, true); + const noiseSuppression = SettingsStore.getValue("webrtc_audio_noiseSuppression", null, true); + + if (preferredAudioOutput) { + params.set("audio_output", preferredAudioOutput); + } + if (preferredAudioInput) { + params.set("audio_input", preferredAudioInput); + } + if (videoInput) { + params.set("video_input", videoInput); + } + if (autoGainControl !== undefined) { + params.set("auto_gaincontrol", autoGainControl.toString()); + } + if (echoCancellation !== undefined) { + params.set("echo_cancellation", echoCancellation.toString()); + } + if (noiseSuppression !== undefined) { + params.set("noise_suppression", noiseSuppression.toString()); + } + + if (SettingsStore.getValue("fallbackICEServerAllowed")) { + params.append("allowIceFallback", "true"); + } + + if (SettingsStore.getValue("feature_allow_screen_share_only_mode")) { + params.append("allowVoipWithNoMedia", "true"); + } + + // Set custom fonts + if (SettingsStore.getValue("useSystemFont")) { + SettingsStore.getValue("systemFont") + .split(",") + .map((font) => { + // Strip whitespace and quotes + font = font.trim(); + if (font.startsWith('"') && font.endsWith('"')) font = font.slice(1, -1); + return font; + }) + .forEach((font) => params.append("font", font)); + } + } + /** * Generate the correct Element Call widget URL for creating or joining a call in this room. * Unless `Developer.elementCallUrl` is set, the widget will use the embedded Element Call package. @@ -700,28 +753,9 @@ export class ElementCall extends Call { params.append("rageshakeSubmitUrl", rageshakeSubmitUrl); } - if (SettingsStore.getValue("fallbackICEServerAllowed")) { - params.append("allowIceFallback", "true"); - } - - if (SettingsStore.getValue("feature_allow_screen_share_only_mode")) { - params.append("allowVoipWithNoMedia", "true"); - } - - // Set custom fonts - if (SettingsStore.getValue("useSystemFont")) { - SettingsStore.getValue("systemFont") - .split(",") - .map((font) => { - // Strip whitespace and quotes - font = font.trim(); - if (font.startsWith('"') && font.endsWith('"')) font = font.slice(1, -1); - return font; - }) - .forEach((font) => params.append("font", font)); - } this.appendAnalyticsParams(params, client); this.appendRoomParams(params, client, roomId); + this.appendSettingsParams(params); const replacedUrl = params.toString().replace(/%24/g, "$"); url.hash = `#?${replacedUrl}`; From c9d0aabe9f2fc06c424bbd8fe418e27d02653f8e Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Thu, 9 Oct 2025 12:04:18 +0100 Subject: [PATCH 2/2] Add a warning --- src/i18n/strings/en_EN.json | 1 + src/settings/Settings.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index b4405e21903..60484dbfc5a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -3084,6 +3084,7 @@ "enable_fallback_ice_server": "Allow fallback call assist server (%(server)s)", "enable_fallback_ice_server_description": "Only applies if your homeserver does not offer one. Your IP address would be shared during a call.", "mirror_local_feed": "Mirror local video feed", + "mirror_local_feed_description": "Not supported when using Element Call", "missing_permissions_prompt": "Missing media permissions, click the button below to request.", "noise_suppression": "Noise suppression", "request_permissions": "Request media permissions", diff --git a/src/settings/Settings.tsx b/src/settings/Settings.tsx index dfb869c31c7..7e40592845d 100644 --- a/src/settings/Settings.tsx +++ b/src/settings/Settings.tsx @@ -941,6 +941,7 @@ export const SETTINGS: Settings = { "VideoView.flipVideoHorizontally": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td("settings|voip|mirror_local_feed"), + description: _td("settings|voip|mirror_local_feed_description"), default: true, }, "theme": {