fix(video-constraints) Fix calculations (#11161)

Only calculate for Large Video on the web (otherwise native breaks)
Take preferred max into calculations
This commit is contained in:
Robert Pintilii 2022-03-17 14:18:49 +02:00 committed by GitHub
parent 649c1b0669
commit a131644dfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -279,14 +279,16 @@ function _updateReceiverVideoConstraints({ getState }) {
const qualityLevel = getVideoQualityForResizableFilmstripThumbnails(state);
visibleRemoteTrackSourceNames.forEach(sourceName => {
receiverConstraints.constraints[sourceName] = { 'maxHeight': qualityLevel };
receiverConstraints.constraints[sourceName] = { 'maxHeight': Math.min(qualityLevel,
maxFrameHeight) };
});
}
if (largeVideoSourceName) {
let quality = maxFrameHeight;
if (!remoteScreenShares.find(id => id === largeVideoParticipantId)) {
if (navigator.product !== 'ReactNative'
&& !remoteScreenShares.find(id => id === largeVideoParticipantId)) {
quality = getVideoQualityForLargeVideo();
}
receiverConstraints.constraints[largeVideoSourceName] = { 'maxHeight': quality };
@ -326,14 +328,16 @@ function _updateReceiverVideoConstraints({ getState }) {
const qualityLevel = getVideoQualityForResizableFilmstripThumbnails(state);
visibleRemoteParticipants.forEach(participantId => {
receiverConstraints.constraints[participantId] = { 'maxHeight': qualityLevel };
receiverConstraints.constraints[participantId] = { 'maxHeight': Math.min(qualityLevel,
maxFrameHeight) };
});
}
if (largeVideoParticipantId) {
let quality = maxFrameHeight;
if (!remoteScreenShares.find(id => id === largeVideoParticipantId)) {
if (navigator.product !== 'ReactNative'
&& !remoteScreenShares.find(id => id === largeVideoParticipantId)) {
quality = getVideoQualityForLargeVideo();
}
receiverConstraints.constraints[largeVideoParticipantId] = { 'maxHeight': quality };