).mockImplementation((_props) => {
return mocked: MatrixAudioRenderer
;
});
diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx
index 015dc0a0..8ca89d6f 100644
--- a/src/room/InCallView.tsx
+++ b/src/room/InCallView.tsx
@@ -98,7 +98,7 @@ import {
} from "../settings/settings";
import { ReactionsReader } from "../reactions/ReactionsReader";
import { useTypedEventEmitter } from "../useEvents.ts";
-import { MatrixAudioRenderer } from "../livekit/MatrixAudioRenderer.tsx";
+import { LivekitRoomAudioRenderer } from "../livekit/MatrixAudioRenderer.tsx";
import { muteAllAudio$ } from "../state/MuteAllAudioModel.ts";
import { useMediaDevices } from "../MediaDevicesContext.ts";
import { EarpieceOverlay } from "./EarpieceOverlay.tsx";
@@ -585,6 +585,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
@@ -720,7 +722,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 d31c95ca..c8cb524f 100644
--- a/src/state/CallViewModel.ts
+++ b/src/state/CallViewModel.ts
@@ -104,7 +104,6 @@ import { type Behavior } from "./Behavior";
import {
enterRTCSession,
getLivekitAlias,
- leaveRTCSession,
makeFocus,
} from "../rtcSessionHelpers";
import { E2eeType } from "../e2ee/e2eeType";
@@ -439,7 +438,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,
@@ -544,6 +546,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(