Simplify speaking observer

This commit is contained in:
Hugh Nimmo-Smith
2024-11-20 10:09:56 +00:00
parent 8f59f087cc
commit 256a65a119

View File

@@ -335,19 +335,14 @@ abstract class BaseUserMediaViewModel extends BaseMediaViewModel {
* Whether the participant is speaking. * Whether the participant is speaking.
*/ */
public readonly speaking = this.participant.pipe( public readonly speaking = this.participant.pipe(
switchMap((p) => { switchMap((p) =>
if (p) { p
return observeParticipantEvents( ? observeParticipantEvents(p, ParticipantEvent.IsSpeakingChanged).pipe(
p, map((p) => p.isSpeaking),
ParticipantEvent.IsSpeakingChanged, )
).pipe( : of(false),
map((p) => p.isSpeaking), ),
this.scope.state(), this.scope.state(),
);
} else {
return of(false);
}
}),
); );
/** /**