Преглед изворни кода

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

Only calculate for Large Video on the web (otherwise native breaks)
Take preferred max into calculations
master
Robert Pintilii пре 3 година
родитељ
комит
a131644dfb
No account linked to committer's email address
1 измењених фајлова са 8 додато и 4 уклоњено
  1. 8
    4
      react/features/video-quality/subscriber.js

+ 8
- 4
react/features/video-quality/subscriber.js Прегледај датотеку

@@ -279,14 +279,16 @@ function _updateReceiverVideoConstraints({ getState }) {
279 279
                 const qualityLevel = getVideoQualityForResizableFilmstripThumbnails(state);
280 280
 
281 281
                 visibleRemoteTrackSourceNames.forEach(sourceName => {
282
-                    receiverConstraints.constraints[sourceName] = { 'maxHeight': qualityLevel };
282
+                    receiverConstraints.constraints[sourceName] = { 'maxHeight': Math.min(qualityLevel,
283
+                        maxFrameHeight) };
283 284
                 });
284 285
             }
285 286
 
286 287
             if (largeVideoSourceName) {
287 288
                 let quality = maxFrameHeight;
288 289
 
289
-                if (!remoteScreenShares.find(id => id === largeVideoParticipantId)) {
290
+                if (navigator.product !== 'ReactNative'
291
+                    && !remoteScreenShares.find(id => id === largeVideoParticipantId)) {
290 292
                     quality = getVideoQualityForLargeVideo();
291 293
                 }
292 294
                 receiverConstraints.constraints[largeVideoSourceName] = { 'maxHeight': quality };
@@ -326,14 +328,16 @@ function _updateReceiverVideoConstraints({ getState }) {
326 328
                 const qualityLevel = getVideoQualityForResizableFilmstripThumbnails(state);
327 329
 
328 330
                 visibleRemoteParticipants.forEach(participantId => {
329
-                    receiverConstraints.constraints[participantId] = { 'maxHeight': qualityLevel };
331
+                    receiverConstraints.constraints[participantId] = { 'maxHeight': Math.min(qualityLevel,
332
+                        maxFrameHeight) };
330 333
                 });
331 334
             }
332 335
 
333 336
             if (largeVideoParticipantId) {
334 337
                 let quality = maxFrameHeight;
335 338
 
336
-                if (!remoteScreenShares.find(id => id === largeVideoParticipantId)) {
339
+                if (navigator.product !== 'ReactNative'
340
+                    && !remoteScreenShares.find(id => id === largeVideoParticipantId)) {
337 341
                     quality = getVideoQualityForLargeVideo();
338 342
                 }
339 343
                 receiverConstraints.constraints[largeVideoParticipantId] = { 'maxHeight': quality };

Loading…
Откажи
Сачувај