This commit is contained in:
Timo
2024-11-05 12:55:48 +01:00
parent 14919cae13
commit b5208ffeae
3 changed files with 2 additions and 29 deletions

View File

@@ -176,7 +176,6 @@ class UserMedia {
member: RoomMember | undefined, member: RoomMember | undefined,
participant: LocalParticipant | RemoteParticipant | undefined, participant: LocalParticipant | RemoteParticipant | undefined,
encryptionSystem: EncryptionSystem, encryptionSystem: EncryptionSystem,
rtcSession: MatrixRTCSession,
) { ) {
this.participant = new BehaviorSubject(participant); this.participant = new BehaviorSubject(participant);
@@ -186,7 +185,6 @@ class UserMedia {
member, member,
this.participant.asObservable() as Observable<LocalParticipant>, this.participant.asObservable() as Observable<LocalParticipant>,
encryptionSystem, encryptionSystem,
rtcSession,
); );
} else { } else {
this.vm = new RemoteUserMediaViewModel( this.vm = new RemoteUserMediaViewModel(
@@ -196,7 +194,6 @@ class UserMedia {
RemoteParticipant | undefined RemoteParticipant | undefined
>, >,
encryptionSystem, encryptionSystem,
rtcSession,
); );
} }
@@ -440,7 +437,6 @@ export class CallViewModel extends ViewModel {
member, member,
participant, participant,
this.encryptionSystem, this.encryptionSystem,
this.matrixRTCSession,
), ),
]; ];
} }
@@ -494,7 +490,6 @@ export class CallViewModel extends ViewModel {
undefined, undefined,
participant, participant,
this.encryptionSystem, this.encryptionSystem,
this.matrixRTCSession,
), ),
]; ];
} }

View File

@@ -37,7 +37,6 @@ import {
switchMap, switchMap,
} from "rxjs"; } from "rxjs";
import { useEffect } from "react"; import { useEffect } from "react";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { ViewModel } from "./ViewModel"; import { ViewModel } from "./ViewModel";
import { useReactiveState } from "../useReactiveState"; import { useReactiveState } from "../useReactiveState";
@@ -206,7 +205,6 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
member: RoomMember | undefined, member: RoomMember | undefined,
participant: Observable<LocalParticipant | RemoteParticipant | undefined>, participant: Observable<LocalParticipant | RemoteParticipant | undefined>,
encryptionSystem: EncryptionSystem, encryptionSystem: EncryptionSystem,
rtcSession: MatrixRTCSession,
) { ) {
super( super(
id, id,
@@ -217,19 +215,6 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
Track.Source.Camera, Track.Source.Camera,
); );
// rtcSession.on(
// MatrixRTCSessionEvent.EncryptionKeyChanged,
// (key, index, participantId) => {
// if (id.startsWith(participantId))
// logger.info("got new keys: ", participant, { index, key });
// logger.info("All keys for participant ", participant, " - ", [
// ...this.keys.value,
// { index, key },
// ]);
// this.keys.next([...this.keys.value, { index, key }]);
// },
// );
const media = participant.pipe( const media = participant.pipe(
switchMap((p) => (p && observeParticipantMedia(p)) ?? of(undefined)), switchMap((p) => (p && observeParticipantMedia(p)) ?? of(undefined)),
this.scope.state(), this.scope.state(),
@@ -280,9 +265,8 @@ export class LocalUserMediaViewModel extends BaseUserMediaViewModel {
member: RoomMember | undefined, member: RoomMember | undefined,
participant: Observable<LocalParticipant | undefined>, participant: Observable<LocalParticipant | undefined>,
encryptionSystem: EncryptionSystem, encryptionSystem: EncryptionSystem,
rtcSession: MatrixRTCSession,
) { ) {
super(id, member, participant, encryptionSystem, rtcSession); super(id, member, participant, encryptionSystem);
} }
} }
@@ -341,9 +325,8 @@ export class RemoteUserMediaViewModel extends BaseUserMediaViewModel {
member: RoomMember | undefined, member: RoomMember | undefined,
participant: Observable<RemoteParticipant | undefined>, participant: Observable<RemoteParticipant | undefined>,
encryptionSystem: EncryptionSystem, encryptionSystem: EncryptionSystem,
rtcSession: MatrixRTCSession,
) { ) {
super(id, member, participant, encryptionSystem, rtcSession); super(id, member, participant, encryptionSystem);
// Sync the local volume with LiveKit // Sync the local volume with LiveKit
combineLatest([ combineLatest([

View File

@@ -15,7 +15,6 @@ import {
RemoteTrackPublication, RemoteTrackPublication,
Room as LivekitRoom, Room as LivekitRoom,
} from "livekit-client"; } from "livekit-client";
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc";
import { import {
LocalUserMediaViewModel, LocalUserMediaViewModel,
@@ -118,7 +117,6 @@ export function mockLocalParticipant(
export async function withLocalMedia( export async function withLocalMedia(
member: Partial<RoomMember>, member: Partial<RoomMember>,
rtcSession: MatrixRTCSession,
continuation: (vm: LocalUserMediaViewModel) => void | Promise<void>, continuation: (vm: LocalUserMediaViewModel) => void | Promise<void>,
): Promise<void> { ): Promise<void> {
const vm = new LocalUserMediaViewModel( const vm = new LocalUserMediaViewModel(
@@ -128,7 +126,6 @@ export async function withLocalMedia(
{ {
kind: E2eeType.PER_PARTICIPANT, kind: E2eeType.PER_PARTICIPANT,
}, },
rtcSession,
); );
try { try {
await continuation(vm); await continuation(vm);
@@ -153,7 +150,6 @@ export function mockRemoteParticipant(
export async function withRemoteMedia( export async function withRemoteMedia(
member: Partial<RoomMember>, member: Partial<RoomMember>,
participant: Partial<RemoteParticipant>, participant: Partial<RemoteParticipant>,
rtcSession: MatrixRTCSession,
continuation: (vm: RemoteUserMediaViewModel) => void | Promise<void>, continuation: (vm: RemoteUserMediaViewModel) => void | Promise<void>,
): Promise<void> { ): Promise<void> {
const vm = new RemoteUserMediaViewModel( const vm = new RemoteUserMediaViewModel(
@@ -163,7 +159,6 @@ export async function withRemoteMedia(
{ {
kind: E2eeType.PER_PARTICIPANT, kind: E2eeType.PER_PARTICIPANT,
}, },
rtcSession,
); );
try { try {
await continuation(vm); await continuation(vm);