Use always show flag in importance ordering

This commit is contained in:
Robin
2024-05-16 13:55:31 -04:00
parent 5647619b36
commit 0d485ef97f

View File

@@ -131,14 +131,14 @@ export type WindowMode = "normal" | "full screen" | "pip";
* Sorting bins defining the order in which media tiles appear in the layout. * Sorting bins defining the order in which media tiles appear in the layout.
*/ */
enum SortingBin { enum SortingBin {
SelfStart, SelfAlwaysShown,
Presenters, Presenters,
Speakers, Speakers,
VideoAndAudio, VideoAndAudio,
Video, Video,
Audio, Audio,
NoMedia, NoMedia,
SelfEnd, SelfNotAlwaysShown,
} }
class UserMedia { class UserMedia {
@@ -410,10 +410,21 @@ export class CallViewModel extends ViewModel {
switchMap((ms) => { switchMap((ms) => {
const bins = ms.map((m) => const bins = ms.map((m) =>
combineLatest( combineLatest(
[m.speaker, m.presenter, m.vm.audioEnabled, m.vm.videoEnabled], [
(speaker, presenter, audio, video) => { m.speaker,
m.presenter,
m.vm.audioEnabled,
m.vm.videoEnabled,
m.vm instanceof LocalUserMediaViewModel
? m.vm.alwaysShow
: of(false),
],
(speaker, presenter, audio, video, alwaysShow) => {
let bin: SortingBin; let bin: SortingBin;
if (m.vm.local) bin = SortingBin.SelfStart; if (m.vm.local)
bin = alwaysShow
? SortingBin.SelfAlwaysShown
: SortingBin.SelfNotAlwaysShown;
else if (presenter) bin = SortingBin.Presenters; else if (presenter) bin = SortingBin.Presenters;
else if (speaker) bin = SortingBin.Speakers; else if (speaker) bin = SortingBin.Speakers;
else if (video) else if (video)