mirror of
https://github.com/vector-im/element-call.git
synced 2026-07-27 19:29:19 +00:00
Simplify speaking observer
This commit is contained in:
@@ -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);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user