@@ -13,10 +13,8 @@ import {
13
13
import {
14
14
type Room as LivekitRoom ,
15
15
type LocalParticipant ,
16
- LocalVideoTrack ,
17
16
ParticipantEvent ,
18
17
type RemoteParticipant ,
19
- Track ,
20
18
} from "livekit-client" ;
21
19
import { RoomStateEvent , type Room , type RoomMember } from "matrix-js-sdk" ;
22
20
import {
@@ -60,7 +58,6 @@ import {
60
58
import {
61
59
LocalUserMediaViewModel ,
62
60
type MediaViewModel ,
63
- observeTrackReference$ ,
64
61
RemoteUserMediaViewModel ,
65
62
ScreenShareViewModel ,
66
63
type UserMediaViewModel ,
@@ -263,6 +260,7 @@ class UserMedia {
263
260
participant : LocalParticipant | RemoteParticipant | undefined ,
264
261
encryptionSystem : EncryptionSystem ,
265
262
livekitRoom : LivekitRoom ,
263
+ mediaDevices : MediaDevices ,
266
264
displayname$ : Observable < string > ,
267
265
handRaised$ : Observable < Date | null > ,
268
266
reaction$ : Observable < ReactionOption | null > ,
@@ -276,6 +274,7 @@ class UserMedia {
276
274
this . participant$ as Behavior < LocalParticipant > ,
277
275
encryptionSystem ,
278
276
livekitRoom ,
277
+ mediaDevices ,
279
278
this . scope . behavior ( displayname$ ) ,
280
279
this . scope . behavior ( handRaised$ ) ,
281
280
this . scope . behavior ( reaction$ ) ,
@@ -390,18 +389,6 @@ function getRoomMemberFromRtcMember(
390
389
391
390
// TODO: Move wayyyy more business logic from the call and lobby views into here
392
391
export class CallViewModel extends ViewModel {
393
- public readonly localVideo$ = this . scope . behavior < LocalVideoTrack | null > (
394
- observeTrackReference$ (
395
- this . livekitRoom . localParticipant ,
396
- Track . Source . Camera ,
397
- ) . pipe (
398
- map ( ( trackRef ) => {
399
- const track = trackRef ?. publication ?. track ;
400
- return track instanceof LocalVideoTrack ? track : null ;
401
- } ) ,
402
- ) ,
403
- ) ;
404
-
405
392
/**
406
393
* The raw list of RemoteParticipants as reported by LiveKit
407
394
*/
@@ -616,6 +603,7 @@ export class CallViewModel extends ViewModel {
616
603
participant ,
617
604
this . options . encryptionSystem ,
618
605
this . livekitRoom ,
606
+ this . mediaDevices ,
619
607
this . memberDisplaynames$ . pipe (
620
608
map ( ( m ) => m . get ( matrixIdentifier ) ?? "[👻]" ) ,
621
609
) ,
@@ -680,6 +668,7 @@ export class CallViewModel extends ViewModel {
680
668
participant ,
681
669
this . options . encryptionSystem ,
682
670
this . livekitRoom ,
671
+ this . mediaDevices ,
683
672
this . memberDisplaynames$ . pipe (
684
673
map (
685
674
( m ) => m . get ( participant . identity ) ?? "[👻]" ,
0 commit comments