Provide speakerHeight to ringrtc
This commit is contained in:
parent
618a7725fe
commit
55a5c51236
7 changed files with 29 additions and 11 deletions
|
@ -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]
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
);
|
||||
}
|
||||
}, [
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue