@@ -62,7 +62,6 @@ import {
6262import {
6363 duplicateTiles ,
6464 MatrixRTCMode ,
65- matrixRTCMode as matrixRTCModeSetting ,
6665 playReactionsSound ,
6766 showReactions ,
6867} from "../../settings/settings" ;
@@ -156,8 +155,8 @@ export interface CallViewModelOptions {
156155 connectionState$ ?: Behavior < ConnectionState > ;
157156 /** Optional behavior overriding the computed window size, mainly for testing purposes. */
158157 windowSize$ ?: Behavior < { width : number ; height : number } > ;
159- /** Optional behavior overriding the MatrixRTC mode, mainly for testing purposes . */
160- matrixRTCMode$ ? : Behavior < MatrixRTCMode > ;
158+ /** The version & compatibility mode of MatrixRTC that we should use . */
159+ matrixRTCMode$ : Behavior < MatrixRTCMode > ;
161160}
162161
163162// Do not play any sounds if the participant count has exceeded this
@@ -408,15 +407,13 @@ export function createCallViewModel$(
408407 memberships$ ,
409408 ) ;
410409
411- const matrixRTCMode$ = options . matrixRTCMode$ ?? matrixRTCModeSetting . value$ ;
412-
413410 const localTransport$ = createLocalTransport$ ( {
414411 scope : scope ,
415412 memberships$ : memberships$ ,
416413 client,
417414 roomId : matrixRoom . roomId ,
418415 useOldestMember$ : scope . behavior (
419- matrixRTCMode$ . pipe ( map ( ( v ) => v === MatrixRTCMode . Legacy ) ) ,
416+ options . matrixRTCMode$ . pipe ( map ( ( v ) => v === MatrixRTCMode . Legacy ) ) ,
420417 ) ,
421418 } ) ;
422419
@@ -468,7 +465,7 @@ export function createCallViewModel$(
468465 } ) ;
469466
470467 const connectOptions$ = scope . behavior (
471- matrixRTCMode$ . pipe (
468+ options . matrixRTCMode$ . pipe (
472469 map ( ( mode ) => ( {
473470 encryptMedia : livekitKeyProvider !== undefined ,
474471 // TODO. This might need to get called again on each change of matrixRTCMode...
0 commit comments