diff --git a/src/state/CallViewModel/CallViewModel.ts b/src/state/CallViewModel/CallViewModel.ts index d9cc9245..a1290061 100644 --- a/src/state/CallViewModel/CallViewModel.ts +++ b/src/state/CallViewModel/CallViewModel.ts @@ -1011,7 +1011,22 @@ export function createCallViewModel$( return screenShares$.pipe( switchMap((screenShares) => { if (screenShares.length > 0) - return of({ spotlight: screenShares, pip$: spotlightSpeaker$ }); + // [lotus #4/A5] During a screenshare, if the host has explicitly + // pinned a participant, surface that camera in the spotlight + // alongside the shared screen (the whole point of "focus camera + // during screenshare"). With no manual pin this is unchanged: + // the screenshare alone is spotlighted. + return combineLatest([manualSpotlightUserId$, userMedia$]).pipe( + map(([manualUserId, mediaItems]) => { + const pinned = + manualUserId !== null + ? mediaItems.find((m) => m.userId === manualUserId) + : undefined; + return pinned + ? { spotlight: [...screenShares, pinned], pip$: of(undefined) } + : { spotlight: screenShares, pip$: spotlightSpeaker$ }; + }), + ); return spotlightSpeaker$.pipe( map((speaker) => ({