From eaf747c107767c94dff4128103f2245210688eb9 Mon Sep 17 00:00:00 2001 From: "Timo K." Date: Thu, 8 Oct 2026 14:19:00 +0200 Subject: [PATCH] adjust to encrypted$ -> encrypted and VideoProcessor independent of LK --- src/state/CallViewModel/CallViewModel.ts | 4 ++-- src/state/media/MemberMediaViewModel.ts | 8 +------- src/utils/test.ts | 2 +- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index b940555fa..9b77dc5af 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -25,8 +25,8 @@ import { trackBySource$, type TransportMetadata, type VideoCaptureSettings, + type VideoProcessor, } from "@element-hq/matrixrtc-sdk"; -import { type Track, type TrackProcessor } from "livekit-client"; import { KnownMembership, type Room as MatrixRoom, @@ -180,7 +180,7 @@ export interface CallViewModelOptions { */ capture?: CaptureSettings; /** Background blur and the like, applied to the camera as it changes. */ - videoProcessor$?: Behavior | undefined>; + videoProcessor$?: Behavior; /** * The application hosting Element Call, which can ask it to hang up and wants * to know when the user joins or leaves. Defaults to no host. diff --git a/src/state/media/MemberMediaViewModel.ts b/src/state/media/MemberMediaViewModel.ts index bdff672d5..a75588f3a 100644 --- a/src/state/media/MemberMediaViewModel.ts +++ b/src/state/media/MemberMediaViewModel.ts @@ -91,13 +91,7 @@ export function createMemberMedia( const unencrypted$ = ( track$: Behavior, ): Observable => - track$.pipe( - switchMap((track) => - track === undefined - ? of(false) - : track.encrypted$.pipe(map((encrypted) => !encrypted)), - ), - ); + track$.pipe(map((track) => track !== undefined && !track.encrypted)); return { ...createBaseMedia(inputs), diff --git a/src/utils/test.ts b/src/utils/test.ts index 7a6677008..205055b60 100644 --- a/src/utils/test.ts +++ b/src/utils/test.ts @@ -310,7 +310,7 @@ export function mockMediaTrack( kind: "video", id: "track", muted$: constant(false), - encrypted$: constant(true), + encrypted: true, stats$: constant(undefined), isActive$: constant(false), attach: vi.fn(),