Skip to content

Commit

Permalink
Don't consider microphone mute state in importance ordering (#2515)
Browse files Browse the repository at this point in the history
We're finding that if we reorder participants based on whether their mic is muted, this just creates a lot of distracting layout shifts. People who speak are automatically promoted into the speaker category, so there's little value in additionally caring about mute state.
  • Loading branch information
robintown authored Jul 26, 2024
1 parent 6b64bdf commit d062871
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/state/CallViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,13 @@ enum SortingBin {
*/
Speakers,
/**
* Participants with both video and audio.
*/
VideoAndAudio,
/**
* Participants with video but no audio.
* Participants with video.
*/
Video,
/**
* Participants with audio but no video.
*/
Audio,
/**
* Participants not sharing any media.
* Participants not sharing any video.
*/
NoMedia,
NoVideo,
/**
* Yourself, when the "always show self" option is off.
*/
Expand Down Expand Up @@ -457,23 +449,21 @@ export class CallViewModel extends ViewModel {
[
m.speaker,
m.presenter,
m.vm.audioEnabled,
m.vm.videoEnabled,
m.vm instanceof LocalUserMediaViewModel
? m.vm.alwaysShow
: of(false),
],
(speaker, presenter, audio, video, alwaysShow) => {
(speaker, presenter, video, alwaysShow) => {
let bin: SortingBin;
if (m.vm.local)
bin = alwaysShow
? SortingBin.SelfAlwaysShown
: SortingBin.SelfNotAlwaysShown;
else if (presenter) bin = SortingBin.Presenters;
else if (speaker) bin = SortingBin.Speakers;
else if (video)
bin = audio ? SortingBin.VideoAndAudio : SortingBin.Video;
else bin = audio ? SortingBin.Audio : SortingBin.NoMedia;
else if (video) bin = SortingBin.Video;
else bin = SortingBin.NoVideo;

return [m, bin] as const;
},
Expand Down

0 comments on commit d062871

Please sign in to comment.