Provide speakerHeight to ringrtc

This commit is contained in:
Fedor Indutny 2022-09-07 08:52:55 -07:00 committed by Fedor Indutnyy
parent 618a7725fe
commit 55a5c51236
7 changed files with 29 additions and 11 deletions

View File

@ -178,10 +178,11 @@ const ActiveCallManager: React.FC<ActiveCallManagerPropsType> = ({
);
const setGroupCallVideoRequestForConversation = useCallback(
(resolutions: Array<GroupCallVideoRequest>) => {
(resolutions: Array<GroupCallVideoRequest>, speakerHeight: number) => {
setGroupCallVideoRequest({
conversationId: conversation.id,
resolutions,
speakerHeight,
});
},
[setGroupCallVideoRequest, conversation.id]

View File

@ -56,7 +56,10 @@ export type PropsType = {
joinedAt?: number;
me: ConversationType;
openSystemPreferencesAction: () => unknown;
setGroupCallVideoRequest: (_: Array<GroupCallVideoRequest>) => void;
setGroupCallVideoRequest: (
_: Array<GroupCallVideoRequest>,
speakerHeight: number
) => void;
setLocalAudio: (_: SetLocalAudioType) => void;
setLocalVideo: (_: SetLocalVideoType) => void;
setLocalPreview: (_: SetLocalPreviewType) => void;

View File

@ -54,7 +54,10 @@ export type PropsType = {
hangUpActiveCall: (reason: string) => void;
hasLocalVideo: boolean;
i18n: LocalizerType;
setGroupCallVideoRequest: (_: Array<GroupCallVideoRequest>) => void;
setGroupCallVideoRequest: (
_: Array<GroupCallVideoRequest>,
speakerHeight: number
) => void;
setLocalPreview: (_: SetLocalPreviewType) => void;
setRendererCanvas: (_: SetRendererCanvasType) => void;
switchToPresentationView: () => void;

View File

@ -76,7 +76,10 @@ export type PropsType = {
activeCall: ActiveCallType;
getGroupCallVideoFrameSource: (demuxId: number) => VideoFrameSource;
i18n: LocalizerType;
setGroupCallVideoRequest: (_: Array<GroupCallVideoRequest>) => void;
setGroupCallVideoRequest: (
_: Array<GroupCallVideoRequest>,
speakerHeight: number
) => void;
setRendererCanvas: (_: SetRendererCanvasType) => void;
};
@ -124,11 +127,13 @@ export const CallingPipRemoteVideo = ({
};
}
return nonRenderedRemoteParticipant(participant);
})
}),
PIP_VIDEO_HEIGHT_PX
);
} else {
setGroupCallVideoRequest(
activeCall.remoteParticipants.map(nonRenderedRemoteParticipant)
activeCall.remoteParticipants.map(nonRenderedRemoteParticipant),
0
);
}
}, [

View File

@ -48,7 +48,10 @@ type PropsType = {
i18n: LocalizerType;
isInSpeakerView: boolean;
remoteParticipants: ReadonlyArray<GroupCallRemoteParticipantType>;
setGroupCallVideoRequest: (_: Array<GroupCallVideoRequest>) => void;
setGroupCallVideoRequest: (
_: Array<GroupCallVideoRequest>,
speakerHeight: number
) => void;
remoteAudioLevels: Map<number, number>;
};
@ -377,7 +380,7 @@ export const GroupCallRemoteParticipants: React.FC<PropsType> = ({
break;
}
setGroupCallVideoRequest(videoRequest);
setGroupCallVideoRequest(videoRequest, gridParticipantHeight);
}, [
devicePixelRatio,
gridParticipantHeight,

View File

@ -830,9 +830,10 @@ export class CallingClass {
public setGroupCallVideoRequest(
conversationId: string,
resolutions: Array<VideoRequest>
resolutions: Array<VideoRequest>,
speakerHeight: number
): void {
this.getGroupCall(conversationId)?.requestVideo(resolutions, 0);
this.getGroupCall(conversationId)?.requestVideo(resolutions, speakerHeight);
}
public groupMembersChanged(conversationId: string): void {

View File

@ -227,6 +227,7 @@ export type SetLocalVideoType = {
export type SetGroupCallVideoRequestType = {
conversationId: string;
resolutions: Array<GroupCallVideoRequest>;
speakerHeight: number;
};
export type StartCallingLobbyType = {
@ -1146,7 +1147,8 @@ function setGroupCallVideoRequest(
// The `framerate` property in RingRTC has to be set, even if it's set to
// `undefined`.
framerate: undefined,
}))
})),
payload.speakerHeight
);
};
}