diff --git a/src/state/CallViewModel.ts b/src/state/CallViewModel.ts index df3ca42ab..0e7e425f3 100644 --- a/src/state/CallViewModel.ts +++ b/src/state/CallViewModel.ts @@ -131,14 +131,15 @@ export type WindowMode = "normal" | "full screen" | "pip"; * Sorting bins defining the order in which media tiles appear in the layout. */ enum SortingBin { - SelfStart, + SelfAlwaysShown, + Pinned, Presenters, Speakers, VideoAndAudio, Video, Audio, NoMedia, - SelfEnd, + SelfNotAlwaysShown, } class UserMedia { @@ -410,10 +411,23 @@ export class CallViewModel extends ViewModel { switchMap((ms) => { const bins = ms.map((m) => 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), + m.vm instanceof RemoteUserMediaViewModel ? m.vm.pin : of(false), + ], + (speaker, presenter, audio, video, alwaysShow, pin) => { let bin: SortingBin; - if (m.vm.local) bin = SortingBin.SelfStart; + if (m.vm.local) + bin = alwaysShow + ? SortingBin.SelfAlwaysShown + : SortingBin.SelfNotAlwaysShown; + else if (pin) bin = SortingBin.Pinned; else if (presenter) bin = SortingBin.Presenters; else if (speaker) bin = SortingBin.Speakers; else if (video) diff --git a/src/tile/GridTile.tsx b/src/tile/GridTile.tsx index 61cbc4361..3a12e6e91 100644 --- a/src/tile/GridTile.tsx +++ b/src/tile/GridTile.tsx @@ -312,6 +312,7 @@ const RemoteUserMediaTile = forwardRef< } secondaryButton={