Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep tiles in a stable order #2670

Merged
merged 11 commits into from
Nov 6, 2024
Prev Previous commit
Next Next commit
Fix speaking indicators logic
  • Loading branch information
hughns committed Nov 6, 2024
commit 7ecccd6aa2564227917d32548bba1cb77435f78d
12 changes: 8 additions & 4 deletions src/state/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -848,23 +848,27 @@ export class CallViewModel extends ViewModel {
);

public showSpeakingIndicators: Observable<boolean> = this.layout.pipe(
map((l) => {
switchMap((l) => {
switch (l.type) {
case "spotlight-landscape":
case "spotlight-portrait":
// If the spotlight is showing the active speaker, we can do without
// speaking indicators as they're a redundant visual cue. But if
// screen sharing feeds are in the spotlight we still need them.
return l.spotlight[0] instanceof ScreenShareViewModel;
return l.spotlight.media.pipe(
map((models: MediaViewModel[]) =>
models.some((m) => m instanceof ScreenShareViewModel),
),
);
// In expanded spotlight layout, the active speaker is always shown in
// the picture-in-picture tile so there is no need for speaking
// indicators. And in one-on-one layout there's no question as to who is
// speaking.
case "spotlight-expanded":
case "one-on-one":
return false;
return of(false);
default:
return true;
return of(true);
}
}),
this.scope.state(),
Expand Down
Loading