enable encryption in per sender case

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2025-09-16 10:13:14 +02:00
parent 7903f3d135
commit 2977038b6b
2 changed files with 25 additions and 22 deletions

View File

@@ -349,6 +349,7 @@ export const GroupCallView: FC<Props> = ({
window.setTimeout(resolve, 10);
});
// TODO-MULTI-SFU find a solution if this is supposed to happen here or in the view model.
leaveRTCSession(
rtcSession,
cause,

View File

@@ -8,6 +8,7 @@ Please see LICENSE in the repository root for full details.
import { observeParticipantEvents } from "@livekit/components-core";
import {
type BaseKeyProvider,
type E2EEOptions,
ExternalE2EEKeyProvider,
type Room as LivekitRoom,
type LocalParticipant,
@@ -414,6 +415,13 @@ export class CallViewModel extends ViewModel {
this.options.encryptionSystem,
this.matrixRTCSession,
);
private readonly e2eeLivekitOptions = (): E2EEOptions | undefined =>
this.livekitE2EEKeyProvider
? {
keyProvider: this.livekitE2EEKeyProvider,
worker: new E2EEWorker(),
}
: undefined;
private readonly localFocus = makeFocus(this.matrixRTCSession);
@@ -427,12 +435,7 @@ export class CallViewModel extends ViewModel {
this.membershipsAndFocusMap$,
this.mediaDevices,
this.muteStates,
this.livekitE2EEKeyProvider
? {
keyProvider: this.livekitE2EEKeyProvider,
worker: new E2EEWorker(),
}
: undefined,
this.e2eeLivekitOptions(),
),
);
@@ -488,12 +491,7 @@ export class CallViewModel extends ViewModel {
this.matrixRTCSession.room.client,
this.scope,
this.membershipsAndFocusMap$,
this.livekitE2EEKeyProvider
? {
keyProvider: this.livekitE2EEKeyProvider,
worker: new E2EEWorker(),
}
: undefined,
this.e2eeLivekitOptions(),
);
} else {
logger.log(
@@ -1709,20 +1707,24 @@ export class CallViewModel extends ViewModel {
void enterRTCSession(
this.matrixRTCSession,
localFocus,
this.options.encryptionSystem.kind !== E2eeType.PER_PARTICIPANT,
this.options.encryptionSystem.kind !== E2eeType.NONE,
true,
true,
);
});
this.join$.pipe(this.scope.bind()).subscribe(() => {
leaveRTCSession(
this.matrixRTCSession,
"user", // TODO-MULTI-SFU ?
// Wait for the sound in widget mode (it's not long)
Promise.resolve(), // TODO-MULTI-SFU
//Promise.all([audioPromise, posthogRequest]),
).catch((e) => {
logger.error("Error leaving RTC session", e);
});
// TODO-MULTI-SFU: this makes no sense what so ever!!!
// need to look into this again.
// leaveRTCSession(
// this.matrixRTCSession,
// "user", // TODO-MULTI-SFU ?
// // Wait for the sound in widget mode (it's not long)
// Promise.resolve(), // TODO-MULTI-SFU
// //Promise.all([audioPromise, posthogRequest]),
// ).catch((e) => {
// logger.error("Error leaving RTC session", e);
// });
});
// Pause upstream of all local media tracks when we're disconnected from