Refactor Matrix/LiveKit session merging
- Replace MatrixLivekitItem with MatrixLivekitMember, add displayName$ and participantId, and use explicit LiveKit participant types - Make sessionBehaviors$ accept a props object and return a typed RxRtcSession - Update CallViewModel to use the new session behaviors, rebuild media items from matrixLivekitMembers, handle missing connections and use participantId-based keys - Change localMembership/localTransport to accept Behavior-based options, read options.value for enterRTCSession, and fix advertised transport selection order - Update tests and minor UI adjustments (settings modal livekitRooms stubbed) and fix JSON formatting in locales
This commit is contained in:
@@ -17,16 +17,29 @@ import { fromEvent, map } from "rxjs";
|
||||
import { type ObservableScope } from "./ObservableScope";
|
||||
import { type Behavior } from "./Behavior";
|
||||
|
||||
export const sessionBehaviors$ = (
|
||||
scope: ObservableScope,
|
||||
matrixRTCSession: MatrixRTCSession,
|
||||
): {
|
||||
interface Props {
|
||||
scope: ObservableScope;
|
||||
matrixRTCSession: MatrixRTCSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps behaviors that we extract from an matrixRTCSession.
|
||||
*/
|
||||
interface RxRtcSession {
|
||||
/**
|
||||
* some prop
|
||||
*/
|
||||
memberships$: Behavior<CallMembership[]>;
|
||||
membershipsWithTransport$: Behavior<
|
||||
{ membership: CallMembership; transport?: LivekitTransport }[]
|
||||
>;
|
||||
transports$: Behavior<LivekitTransport[]>;
|
||||
} => {
|
||||
}
|
||||
|
||||
export const sessionBehaviors$ = ({
|
||||
scope,
|
||||
matrixRTCSession,
|
||||
}: Props): RxRtcSession => {
|
||||
const memberships$ = scope.behavior(
|
||||
fromEvent(
|
||||
matrixRTCSession,
|
||||
|
||||
Reference in New Issue
Block a user