Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
74 changes: 54 additions & 20 deletions src/models/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,59 @@
}
}

/**
* 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());

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)

Check failure on line 686 in src/models/Call.ts

View workflow job for this annotation

GitHub Actions / Jest (2)

RoomView › video rooms › normally doesn't open the chat panel

TypeError: Cannot read properties of null (reading 'toString') at Function.toString [as appendSettingsParams] (src/models/Call.ts:686:60) at Function.appendSettingsParams [as generateWidgetUrl] (src/models/Call.ts:758:14) at Function.generateWidgetUrl [as createOrGetCallWidget] (src/models/Call.ts:777:33) at Function.createOrGetCallWidget [as create] (src/models/Call.ts:851:21) at RoomViewStore.create [as viewRoom] (src/stores/RoomViewStore.tsx:358:33) at RoomViewStore.viewRoom [as onDispatch] (src/stores/RoomViewStore.tsx:216:22) at MatrixDispatcher.invokeCallback (src/dispatcher/dispatcher.ts:115:31) at invokeCallback (src/dispatcher/dispatcher.ts:92:22) at Timeout.task [as _onTimeout] (node_modules/jsdom/lib/jsdom/browser/Window.js:520:19)
}
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.
Expand Down Expand Up @@ -700,28 +753,9 @@
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}`;
Expand Down
1 change: 1 addition & 0 deletions src/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading