Restore call view mode after presentation end

This commit is contained in:
Fedor Indutny 2022-05-25 11:03:27 -07:00 committed by GitHub
parent 9e1528fa24
commit 80c90540f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 289 additions and 51 deletions

View file

@ -57,8 +57,9 @@ export type PropsType = {
setGroupCallVideoRequest: (_: Array<GroupCallVideoRequest>) => void;
setLocalPreview: (_: SetLocalPreviewType) => void;
setRendererCanvas: (_: SetRendererCanvasType) => void;
switchToPresentationView: () => void;
switchFromPresentationView: () => void;
togglePip: () => void;
toggleSpeakerView: () => void;
};
const PIP_HEIGHT = 156;
@ -75,8 +76,9 @@ export const CallingPip = ({
setGroupCallVideoRequest,
setLocalPreview,
setRendererCanvas,
switchToPresentationView,
switchFromPresentationView,
togglePip,
toggleSpeakerView,
}: PropsType): JSX.Element | null => {
const videoContainerRef = React.useRef<null | HTMLDivElement>(null);
const localVideoRef = React.useRef(null);
@ -88,11 +90,11 @@ export const CallingPip = ({
offsetY: PIP_TOP_MARGIN,
});
useActivateSpeakerViewOnPresenting(
activeCall.remoteParticipants,
activeCall.isInSpeakerView,
toggleSpeakerView
);
useActivateSpeakerViewOnPresenting({
remoteParticipants: activeCall.remoteParticipants,
switchToPresentationView,
switchFromPresentationView,
});
React.useEffect(() => {
setLocalPreview({ element: localVideoRef });