diff --git a/ts/components/CallingPipRemoteVideo.tsx b/ts/components/CallingPipRemoteVideo.tsx index cd1e81920..495954a2b 100644 --- a/ts/components/CallingPipRemoteVideo.tsx +++ b/ts/components/CallingPipRemoteVideo.tsx @@ -18,6 +18,7 @@ import { import { SetRendererCanvasType } from '../state/ducks/calling'; import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer'; import { usePageVisibility } from '../util/hooks'; +import { missingCaseError } from '../util/missingCaseError'; import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant'; // This value should be kept in sync with the hard-coded CSS height. @@ -131,42 +132,39 @@ export const CallingPipRemoteVideo = ({ setGroupCallVideoRequest, ]); - if (activeCall.callMode === CallMode.Direct) { - const { hasRemoteVideo } = activeCall.remoteParticipants[0]; - - if (!hasRemoteVideo) { - return ; + switch (activeCall.callMode) { + case CallMode.Direct: { + const { hasRemoteVideo } = activeCall.remoteParticipants[0]; + if (!hasRemoteVideo) { + return ; + } + return ( +
+ +
+ ); } - - return ( -
- -
- ); + case CallMode.Group: + if (!activeGroupCallSpeaker) { + return ; + } + return ( +
+ +
+ ); + default: + throw missingCaseError(activeCall); } - - if (activeCall.callMode === CallMode.Group) { - if (!activeGroupCallSpeaker) { - return ; - } - - return ( -
- -
- ); - } - - throw new Error('CallingRemoteVideo: Unknown Call Mode'); };