This commit is contained in:
Hugh Nimmo-Smith
2024-11-07 13:01:48 +00:00
parent 0760796024
commit 95effe0852
2 changed files with 8 additions and 14 deletions

View File

@@ -443,7 +443,7 @@ export class CallViewModel extends ViewModel {
remoteParticipants, remoteParticipants,
{ participant: localParticipant }, { participant: localParticipant },
duplicateTiles, duplicateTiles,
_participantChange, _membershipsChanged,
nonMemberTiles, nonMemberTiles,
], ],
) => { ) => {
@@ -682,16 +682,11 @@ export class CallViewModel extends ViewModel {
); );
private readonly spotlightAndPip: Observable< private readonly spotlightAndPip: Observable<
[Observable<MediaViewModel[]>, Observable<UserMediaViewModel | null>] [Observable<MediaViewModel[]>, Observable<UserMediaViewModel | undefined>]
> = this.screenShares.pipe( > = this.screenShares.pipe(
map((screenShares) => map((screenShares) =>
screenShares.length > 0 screenShares.length > 0
? ([ ? ([of(screenShares.map((m) => m.vm)), this.spotlightSpeaker] as const)
of(screenShares.map((m) => m.vm)),
this.spotlightSpeaker.pipe(
map((speaker) => (speaker && speaker) ?? null),
),
] as const)
: ([ : ([
this.spotlightSpeaker.pipe( this.spotlightSpeaker.pipe(
map((speaker) => (speaker && [speaker]) ?? []), map((speaker) => (speaker && [speaker]) ?? []),
@@ -700,15 +695,15 @@ export class CallViewModel extends ViewModel {
switchMap((speaker) => switchMap((speaker) =>
speaker speaker
? speaker.local ? speaker.local
? of(null) ? of(undefined)
: this.localUserMedia.pipe( : this.localUserMedia.pipe(
switchMap((vm) => switchMap((vm) =>
vm.alwaysShow.pipe( vm.alwaysShow.pipe(
map((alwaysShow) => (alwaysShow ? vm : null)), map((alwaysShow) => (alwaysShow ? vm : undefined)),
), ),
), ),
) )
: of(null), : of(undefined),
), ),
), ),
] as const), ] as const),

View File

@@ -78,7 +78,7 @@ export function observeTrackReference(
participant: Observable<Participant | undefined>, participant: Observable<Participant | undefined>,
source: Track.Source, source: Track.Source,
): Observable<TrackReferenceOrPlaceholder | undefined> { ): Observable<TrackReferenceOrPlaceholder | undefined> {
const obs = participant.pipe( return participant.pipe(
switchMap((p) => { switchMap((p) => {
if (p) { if (p) {
return observeParticipantMedia(p).pipe( return observeParticipantMedia(p).pipe(
@@ -94,7 +94,6 @@ export function observeTrackReference(
} }
}), }),
); );
return obs;
} }
function observeRemoteTrackReceivingOkay( function observeRemoteTrackReceivingOkay(
@@ -232,7 +231,7 @@ abstract class BaseMediaViewModel extends ViewModel {
// TODO: Fully separate the data layer from the UI layer by keeping the // TODO: Fully separate the data layer from the UI layer by keeping the
// member object internal // member object internal
public readonly member: RoomMember | undefined, public readonly member: RoomMember | undefined,
// We dont necassarly have a participant if a user connects via MatrixRTC but not (not yet) through // We dont necessarily have a participant if a user connects via MatrixRTC but not (not yet) through
// livekit. // livekit.
protected readonly participant: Observable< protected readonly participant: Observable<
LocalParticipant | RemoteParticipant | undefined LocalParticipant | RemoteParticipant | undefined