Respect changing PPI during screen share

This commit is contained in:
Evan Hahn 2022-01-06 16:00:11 -06:00 committed by GitHub
parent e98b281644
commit 5eee11e89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -17,6 +17,7 @@ import type {
import { useGetCallingFrameBuffer } from '../calling/useGetCallingFrameBuffer';
import type { LocalizerType } from '../types/Util';
import { usePageVisibility } from '../hooks/usePageVisibility';
import { useDevicePixelRatio } from '../hooks/useDevicePixelRatio';
import { nonRenderedRemoteParticipant } from '../util/ringrtc/nonRenderedRemoteParticipant';
import { missingCaseError } from '../util/missingCaseError';
import { SECOND } from '../util/durations';
@ -94,6 +95,8 @@ export const GroupCallRemoteParticipants: React.FC<PropsType> = ({
height: 0,
});
const devicePixelRatio = useDevicePixelRatio();
const getFrameBuffer = useGetCallingFrameBuffer();
const { invisibleDemuxIds, onParticipantVisibilityChanged } =
@ -298,9 +301,8 @@ export const GroupCallRemoteParticipants: React.FC<PropsType> = ({
...gridParticipants.map(participant => {
let scalar: number;
if (participant.sharingScreen) {
// We want best-resolution video if someone is sharing their screen. This
// code is extra-defensive against strange devicePixelRatios.
scalar = Math.max(window.devicePixelRatio || 1, 1);
// We want best-resolution video if someone is sharing their screen.
scalar = Math.max(devicePixelRatio, 1);
} else if (participant.hasRemoteVideo) {
scalar = VIDEO_REQUEST_SCALAR;
} else {
@ -357,13 +359,14 @@ export const GroupCallRemoteParticipants: React.FC<PropsType> = ({
setGroupCallVideoRequest(videoRequest);
}, [
devicePixelRatio,
gridParticipantHeight,
videoRequestMode,
gridParticipants,
invisibleDemuxIds,
overflowedParticipants,
remoteParticipants,
setGroupCallVideoRequest,
gridParticipants,
videoRequestMode,
]);
return (