mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-09 18:29:21 +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. |
|
| `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. |
|
| `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. |
|
| `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
|
### Widget-only parameters
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,10 @@
|
|||||||
"livekit_server_info": "LiveKit Server Info",
|
"livekit_server_info": "LiveKit Server Info",
|
||||||
"livekit_sfu": "LiveKit SFU: {{url}}",
|
"livekit_sfu": "LiveKit SFU: {{url}}",
|
||||||
"matrix_id": "Matrix ID: {{id}}",
|
"matrix_id": "Matrix ID: {{id}}",
|
||||||
"multi_sfu": "Multi-SFU media transport",
|
|
||||||
"mute_all_audio": "Mute all audio (participants, reactions, join sounds)",
|
"mute_all_audio": "Mute all audio (participants, reactions, join sounds)",
|
||||||
"prefer_sticky_events": {
|
"multi_sfu": {
|
||||||
"description": "Improves reliability of calls (requires homeserver support)",
|
"description": "Allows multiple SFUs to be present in a call (requires homeserver support)",
|
||||||
"label": "Prefer sticky events"
|
"label": "Multi-SFU media transport"
|
||||||
},
|
},
|
||||||
"show_connection_stats": "Show connection statistics",
|
"show_connection_stats": "Show connection statistics",
|
||||||
"url_params": "URL parameters"
|
"url_params": "URL parameters"
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export interface UrlProperties {
|
|||||||
* Whether or not the call should be held using the sticky event implementation,
|
* Whether or not the call should be held using the sticky event implementation,
|
||||||
* where possible.
|
* where possible.
|
||||||
*/
|
*/
|
||||||
preferStickyEvents: boolean;
|
multiSFU: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -506,7 +506,7 @@ export const computeUrlParams = (search = "", hash = ""): UrlParams => {
|
|||||||
sentryDsn: parser.getParam("sentryDsn"),
|
sentryDsn: parser.getParam("sentryDsn"),
|
||||||
sentryEnvironment: parser.getParam("sentryEnvironment"),
|
sentryEnvironment: parser.getParam("sentryEnvironment"),
|
||||||
e2eEnabled: parser.getFlagParam("enableE2EE", true),
|
e2eEnabled: parser.getFlagParam("enableE2EE", true),
|
||||||
preferStickyEvents: parser.getFlagParam("preferStickyEvents", false),
|
multiSFU: parser.getFlagParam("useMultiSFU", false),
|
||||||
};
|
};
|
||||||
|
|
||||||
const configuration: Partial<UrlConfiguration> = {
|
const configuration: Partial<UrlConfiguration> = {
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import {
|
|||||||
multiSfu as multiSfuSetting,
|
multiSfu as multiSfuSetting,
|
||||||
muteAllAudio as muteAllAudioSetting,
|
muteAllAudio as muteAllAudioSetting,
|
||||||
alwaysShowIphoneEarpiece as alwaysShowIphoneEarpieceSetting,
|
alwaysShowIphoneEarpiece as alwaysShowIphoneEarpieceSetting,
|
||||||
preferStickyEvents as preferStickyEventsSetting,
|
|
||||||
} from "./settings";
|
} from "./settings";
|
||||||
import type { Room as LivekitRoom } from "livekit-client";
|
import type { Room as LivekitRoom } from "livekit-client";
|
||||||
import styles from "./DeveloperSettingsTab.module.css";
|
import styles from "./DeveloperSettingsTab.module.css";
|
||||||
@@ -59,10 +58,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
|||||||
});
|
});
|
||||||
}, [client]);
|
}, [client]);
|
||||||
|
|
||||||
const [preferStickyEvents, setPreferStickyEvents] = useSetting(
|
|
||||||
preferStickyEventsSetting,
|
|
||||||
);
|
|
||||||
|
|
||||||
const [showConnectionStats, setShowConnectionStats] = useSetting(
|
const [showConnectionStats, setShowConnectionStats] = useSetting(
|
||||||
showConnectionStatsSetting,
|
showConnectionStatsSetting,
|
||||||
);
|
);
|
||||||
@@ -146,22 +141,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</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>
|
<FieldRow>
|
||||||
<InputField
|
<InputField
|
||||||
id="showConnectionStats"
|
id="showConnectionStats"
|
||||||
@@ -180,10 +159,10 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRooms }) => {
|
|||||||
<InputField
|
<InputField
|
||||||
id="multiSfu"
|
id="multiSfu"
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
label={t("developer_mode.multi_sfu")}
|
label={t("developer_mode.multi_sfu.label")}
|
||||||
// If using sticky events we implicitly prefer use multi-sfu
|
description={t("developer_mode.multi_sfu.description")}
|
||||||
checked={multiSfu || preferStickyEvents}
|
checked={multiSfu}
|
||||||
disabled={preferStickyEvents}
|
disabled={!stickyEventsSupported}
|
||||||
onChange={useCallback(
|
onChange={useCallback(
|
||||||
(event: ChangeEvent<HTMLInputElement>): void => {
|
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||||
setMultiSfu(event.target.checked);
|
setMultiSfu(event.target.checked);
|
||||||
|
|||||||
@@ -83,11 +83,6 @@ export const showConnectionStats = new Setting<boolean>(
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
export const preferStickyEvents = new Setting<boolean>(
|
|
||||||
"prefer-sticky-events",
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
|
|
||||||
export const audioInput = new Setting<string | undefined>(
|
export const audioInput = new Setting<string | undefined>(
|
||||||
"audio-input",
|
"audio-input",
|
||||||
undefined,
|
undefined,
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ import {
|
|||||||
duplicateTiles,
|
duplicateTiles,
|
||||||
multiSfu,
|
multiSfu,
|
||||||
playReactionsSound,
|
playReactionsSound,
|
||||||
preferStickyEvents,
|
|
||||||
showReactions,
|
showReactions,
|
||||||
} from "../settings/settings";
|
} from "../settings/settings";
|
||||||
import { isFirefox } from "../Platform";
|
import { isFirefox } from "../Platform";
|
||||||
@@ -288,15 +287,10 @@ export class CallViewModel {
|
|||||||
switchMap((joined) =>
|
switchMap((joined) =>
|
||||||
joined
|
joined
|
||||||
? combineLatest(
|
? combineLatest(
|
||||||
[
|
[this.preferredTransport$, this.memberships$, multiSfu.value$],
|
||||||
this.preferredTransport$,
|
(preferred, memberships, preferMultiSfu) => {
|
||||||
this.memberships$,
|
|
||||||
multiSfu.value$,
|
|
||||||
preferStickyEvents.value$,
|
|
||||||
],
|
|
||||||
(preferred, memberships, preferMultiSfu, preferStickyEvents) => {
|
|
||||||
// Multi-SFU must be implicitly enabled when using sticky events
|
// Multi-SFU must be implicitly enabled when using sticky events
|
||||||
const multiSfu = preferStickyEvents || preferMultiSfu;
|
const multiSfu = preferMultiSfu;
|
||||||
|
|
||||||
const oldestMembership =
|
const oldestMembership =
|
||||||
this.matrixRTCSession.getOldestMembership();
|
this.matrixRTCSession.getOldestMembership();
|
||||||
@@ -333,7 +327,7 @@ export class CallViewModel {
|
|||||||
remote,
|
remote,
|
||||||
preferred,
|
preferred,
|
||||||
multiSfu,
|
multiSfu,
|
||||||
preferStickyEvents,
|
preferStickyEvents: multiSfu,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -1834,9 +1828,8 @@ export class CallViewModel {
|
|||||||
await enterRTCSession(this.matrixRTCSession, advertised.transport, {
|
await enterRTCSession(this.matrixRTCSession, advertised.transport, {
|
||||||
encryptMedia: this.options.encryptionSystem.kind !== E2eeType.NONE,
|
encryptMedia: this.options.encryptionSystem.kind !== E2eeType.NONE,
|
||||||
useMultiSfu: advertised.multiSfu,
|
useMultiSfu: advertised.multiSfu,
|
||||||
preferStickyEvents:
|
// Multi-SFU enables sticky events.
|
||||||
this.urlParams.preferStickyEvents &&
|
preferStickyEvents: advertised.multiSfu ?? this.urlParams.multiSFU,
|
||||||
advertised.preferStickyEvents,
|
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("Error entering RTC session", e);
|
logger.error("Error entering RTC session", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user