mirror of
https://github.com/vector-im/element-call.git
synced 2026-03-19 06:20:25 +00:00
Refactor to remove preferStickyEvents
This commit is contained in:
@@ -72,7 +72,7 @@ These parameters are relevant to both [widget](./embedded-standalone.md) and [st
|
||||
| `sendNotificationType` | `ring` or `notification` | No | No | Will send a "ring" or "notification" `m.rtc.notification` event if the user is the first one in the call. |
|
||||
| `autoLeaveWhenOthersLeft` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Whether the app should automatically leave the call when there is no one left in the call. |
|
||||
| `waitForCallPickup` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | When sending a notification, show UI that the app is awaiting an answer, play a dial tone, and (in widget mode) auto-close the widget once the notification expires. |
|
||||
| `preferStickyEvents` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Enables using sticky events to derive call membership. |
|
||||
| `multiSFU` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Enables experimental new multiSFU support. |
|
||||
|
||||
### Widget-only parameters
|
||||
|
||||
|
||||
@@ -72,11 +72,10 @@
|
||||
"livekit_server_info": "LiveKit Server Info",
|
||||
"livekit_sfu": "LiveKit SFU: {{url}}",
|
||||
"matrix_id": "Matrix ID: {{id}}",
|
||||
"multi_sfu": "Multi-SFU media transport",
|
||||
"mute_all_audio": "Mute all audio (participants, reactions, join sounds)",
|
||||
"prefer_sticky_events": {
|
||||
"description": "Improves reliability of calls (requires homeserver support)",
|
||||
"label": "Prefer sticky events"
|
||||
"multi_sfu": {
|
||||
"description": "Allows multiple SFUs to be present in a call (requires homeserver support)",
|
||||
"label": "Multi-SFU media transport"
|
||||
},
|
||||
"show_connection_stats": "Show connection statistics",
|
||||
"url_params": "URL parameters"
|
||||
|
||||
@@ -145,7 +145,7 @@ export interface UrlProperties {
|
||||
* Whether or not the call should be held using the sticky event implementation,
|
||||
* where possible.
|
||||
*/
|
||||
preferStickyEvents: boolean;
|
||||
multiSFU: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -506,7 +506,7 @@ export const computeUrlParams = (search = "", hash = ""): UrlParams => {
|
||||
sentryDsn: parser.getParam("sentryDsn"),
|
||||
sentryEnvironment: parser.getParam("sentryEnvironment"),
|
||||
e2eEnabled: parser.getFlagParam("enableE2EE", true),
|
||||
preferStickyEvents: parser.getFlagParam("preferStickyEvents", false),
|
||||
multiSFU: parser.getFlagParam("useMultiSFU", false),
|
||||
};
|
||||
|
||||
const configuration: Partial<UrlConfiguration> = {
|
||||
|
||||
@@ -29,7 +29,6 @@ import {
|
||||
multiSfu as multiSfuSetting,
|
||||
muteAllAudio as muteAllAudioSetting,
|
||||
alwaysShowIphoneEarpiece as alwaysShowIphoneEarpieceSetting,
|
||||
preferStickyEvents as preferStickyEventsSetting,
|
||||
} from "./settings";
|
||||
import type { Room as LivekitRoom } from "livekit-client";
|
||||
import styles from "./DeveloperSettingsTab.module.css";
|
||||
@@ -59,10 +58,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
||||
});
|
||||
}, [client]);
|
||||
|
||||
const [preferStickyEvents, setPreferStickyEvents] = useSetting(
|
||||
preferStickyEventsSetting,
|
||||
);
|
||||
|
||||
const [showConnectionStats, setShowConnectionStats] = useSetting(
|
||||
showConnectionStatsSetting,
|
||||
);
|
||||
@@ -146,22 +141,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
||||
}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="preferStickyEvents"
|
||||
type="checkbox"
|
||||
label={t("developer_mode.prefer_sticky_events.label")}
|
||||
disabled={!stickyEventsSupported}
|
||||
description={t("developer_mode.prefer_sticky_events.description")}
|
||||
checked={!!preferStickyEvents}
|
||||
onChange={useCallback(
|
||||
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||
setPreferStickyEvents(event.target.checked);
|
||||
},
|
||||
[setPreferStickyEvents],
|
||||
)}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="showConnectionStats"
|
||||
@@ -180,10 +159,10 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
||||
<InputField
|
||||
id="multiSfu"
|
||||
type="checkbox"
|
||||
label={t("developer_mode.multi_sfu")}
|
||||
// If using sticky events we implicitly prefer use multi-sfu
|
||||
checked={multiSfu || preferStickyEvents}
|
||||
disabled={preferStickyEvents}
|
||||
label={t("developer_mode.multi_sfu.label")}
|
||||
description={t("developer_mode.multi_sfu.description")}
|
||||
checked={multiSfu}
|
||||
disabled={!stickyEventsSupported}
|
||||
onChange={useCallback(
|
||||
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||
setMultiSfu(event.target.checked);
|
||||
|
||||
@@ -83,11 +83,6 @@ export const showConnectionStats = new Setting<boolean>(
|
||||
false,
|
||||
);
|
||||
|
||||
export const preferStickyEvents = new Setting<boolean>(
|
||||
"prefer-sticky-events",
|
||||
false,
|
||||
);
|
||||
|
||||
export const audioInput = new Setting<string | undefined>(
|
||||
"audio-input",
|
||||
undefined,
|
||||
|
||||
@@ -91,7 +91,6 @@ import {
|
||||
duplicateTiles,
|
||||
multiSfu,
|
||||
playReactionsSound,
|
||||
preferStickyEvents,
|
||||
showReactions,
|
||||
} from "../settings/settings";
|
||||
import { isFirefox } from "../Platform";
|
||||
@@ -288,15 +287,10 @@ export class CallViewModel {
|
||||
switchMap((joined) =>
|
||||
joined
|
||||
? combineLatest(
|
||||
[
|
||||
this.preferredTransport$,
|
||||
this.memberships$,
|
||||
multiSfu.value$,
|
||||
preferStickyEvents.value$,
|
||||
],
|
||||
(preferred, memberships, preferMultiSfu, preferStickyEvents) => {
|
||||
[this.preferredTransport$, this.memberships$, multiSfu.value$],
|
||||
(preferred, memberships, preferMultiSfu) => {
|
||||
// Multi-SFU must be implicitly enabled when using sticky events
|
||||
const multiSfu = preferStickyEvents || preferMultiSfu;
|
||||
const multiSfu = preferMultiSfu;
|
||||
|
||||
const oldestMembership =
|
||||
this.matrixRTCSession.getOldestMembership();
|
||||
@@ -333,7 +327,7 @@ export class CallViewModel {
|
||||
remote,
|
||||
preferred,
|
||||
multiSfu,
|
||||
preferStickyEvents,
|
||||
preferStickyEvents: multiSfu,
|
||||
};
|
||||
},
|
||||
)
|
||||
@@ -1834,9 +1828,8 @@ export class CallViewModel {
|
||||
await enterRTCSession(this.matrixRTCSession, advertised.transport, {
|
||||
encryptMedia: this.options.encryptionSystem.kind !== E2eeType.NONE,
|
||||
useMultiSfu: advertised.multiSfu,
|
||||
preferStickyEvents:
|
||||
this.urlParams.preferStickyEvents &&
|
||||
advertised.preferStickyEvents,
|
||||
// Multi-SFU enables sticky events.
|
||||
preferStickyEvents: advertised.multiSfu ?? this.urlParams.multiSFU,
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error("Error entering RTC session", e);
|
||||
|
||||
Reference in New Issue
Block a user