).mockImplementation((_props) => {
return mocked: MatrixAudioRenderer
;
});
diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx
index 3d7ce8db..1e92d110 100644
--- a/src/room/InCallView.tsx
+++ b/src/room/InCallView.tsx
@@ -106,6 +106,7 @@ import {
} from "../settings/settings";
import { ReactionsReader } from "../reactions/ReactionsReader";
import { useTypedEventEmitter } from "../useEvents.ts";
+import { LivekitRoomAudioRenderer } from "../livekit/MatrixAudioRenderer.tsx";
import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts";
import { useMediaDevices } from "../MediaDevicesContext.ts";
import { EarpieceOverlay } from "./EarpieceOverlay.tsx";
@@ -151,7 +152,6 @@ export const ActiveCall: FC = (props) => {
},
reactionsReader.raisedHands$,
reactionsReader.reactions$,
- props.e2eeSystem,
);
setVm(vm);
return (): void => {
@@ -746,6 +746,8 @@ export const InCallView: FC = ({
matrixRoom.roomId,
);
+ const allLivekitRooms = useBehavior(vm.allLivekitRooms$);
+ const memberships = useBehavior(vm.memberships$);
const toggleScreensharing = useCallback(() => {
throw new Error("TODO-MULTI-SFU");
// localParticipant
@@ -878,7 +880,14 @@ export const InCallView: FC = ({
)
}
- {/* TODO-MULTI-SFU: */}
+ {allLivekitRooms.map((roomItem) => (
+
+ ))}
{renderContent()}
diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts
index 7da4aaef..57917426 100644
--- a/src/state/CallViewModel.ts
+++ b/src/state/CallViewModel.ts
@@ -116,7 +116,6 @@ import { type Behavior } from "./Behavior";
import {
enterRTCSession,
getLivekitAlias,
- leaveRTCSession,
makeFocus,
} from "../rtcSessionHelpers";
import { E2eeType } from "../e2ee/e2eeType";
@@ -462,7 +461,10 @@ export class CallViewModel extends ViewModel {
),
);
- private readonly memberships$ = this.scope.behavior(
+ // TODO-MULTI-SFU make sure that we consider the room memberships here as well (so that here we only have valid memberships)
+ // this also makes it possible to use this memberships$ list in all observables based on it.
+ // there should be no other call to: this.matrixRTCSession.memberships!
+ public readonly memberships$ = this.scope.behavior(
fromEvent(
this.matrixRTCSession,
MatrixRTCSessionEvent.MembershipsChanged,
@@ -567,6 +569,26 @@ export class CallViewModel extends ViewModel {
concatMap(({ stop }) => stop),
);
+ public readonly allLivekitRooms$ = this.scope.behavior(
+ combineLatest([
+ this.remoteConnections$,
+ this.localConnection,
+ this.localFocus,
+ ]).pipe(
+ map(([remoteConnections, localConnection, localFocus]) =>
+ Array.from(remoteConnections.entries())
+ .map(([index, c]) => ({ room: c.livekitRoom, url: index }))
+ .concat([
+ {
+ room: localConnection.livekitRoom,
+ url: localFocus.livekit_service_url,
+ },
+ ]),
+ ),
+ startWith([]),
+ ),
+ );
+
private readonly userId = this.matrixRoom.client.getUserId();
private readonly matrixConnected$ = this.scope.behavior(