소스 검색

Makes video aspect ratio an optional constraint in order to fix failures in which available resolutions meet the constraints on the width and height of a requested resolution but none of the available resolutions satisfy the constraint with respect to aspect ratio.

j8
Lyubomir Marinov 11 년 전
부모
커밋
7c16d55094
1개의 변경된 파일10개의 추가작업 그리고 8개의 파일을 삭제
  1. 10
    8
      libs/strophe/strophe.jingle.adapter.js

+ 10
- 8
libs/strophe/strophe.jingle.adapter.js 파일 보기

510
     var constraints = {audio: false, video: false};
510
     var constraints = {audio: false, video: false};
511
 
511
 
512
     if (um.indexOf('video') >= 0) {
512
     if (um.indexOf('video') >= 0) {
513
-        constraints.video = {mandatory: {}};// same behaviour as true
513
+        constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
514
     }
514
     }
515
     if (um.indexOf('audio') >= 0) {
515
     if (um.indexOf('audio') >= 0) {
516
         constraints.audio = {};// same behaviour as true
516
         constraints.audio = {};// same behaviour as true
523
                 maxWidth: window.screen.width,
523
                 maxWidth: window.screen.width,
524
                 maxHeight: window.screen.height,
524
                 maxHeight: window.screen.height,
525
                 maxFrameRate: 3
525
                 maxFrameRate: 3
526
-            }
526
+            },
527
+            optional: []
527
         };
528
         };
528
     }
529
     }
529
     if (um.indexOf('desktop') >= 0) {
530
     if (um.indexOf('desktop') >= 0) {
535
                 maxWidth: window.screen.width,
536
                 maxWidth: window.screen.width,
536
                 maxHeight: window.screen.height,
537
                 maxHeight: window.screen.height,
537
                 maxFrameRate: 3
538
                 maxFrameRate: 3
538
-            }
539
+            },
540
+            optional: []
539
         }
541
         }
540
     }
542
     }
541
 
543
 
543
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
545
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
544
 
546
 
545
     if (resolution && !constraints.video || isAndroid) {
547
     if (resolution && !constraints.video || isAndroid) {
546
-        constraints.video = {mandatory: {}};// same behaviour as true
548
+        constraints.video = { mandatory: {}, optional: [] };// same behaviour as true
547
     }
549
     }
548
     // see https://code.google.com/p/chromium/issues/detail?id=143631#c9 for list of supported resolutions
550
     // see https://code.google.com/p/chromium/issues/detail?id=143631#c9 for list of supported resolutions
549
     switch (resolution) {
551
     switch (resolution) {
552
         case 'fullhd':
554
         case 'fullhd':
553
             constraints.video.mandatory.minWidth = 1920;
555
             constraints.video.mandatory.minWidth = 1920;
554
             constraints.video.mandatory.minHeight = 1080;
556
             constraints.video.mandatory.minHeight = 1080;
555
-            constraints.video.mandatory.minAspectRatio = 1.77;
557
+            constraints.video.optional.push({ minAspectRatio: 1.77 });
556
             break;
558
             break;
557
         case '720':
559
         case '720':
558
         case 'hd':
560
         case 'hd':
559
             constraints.video.mandatory.minWidth = 1280;
561
             constraints.video.mandatory.minWidth = 1280;
560
             constraints.video.mandatory.minHeight = 720;
562
             constraints.video.mandatory.minHeight = 720;
561
-            constraints.video.mandatory.minAspectRatio = 1.77;
563
+            constraints.video.optional.push({ minAspectRatio: 1.77 });
562
             break;
564
             break;
563
         case '360':
565
         case '360':
564
             constraints.video.mandatory.minWidth = 640;
566
             constraints.video.mandatory.minWidth = 640;
565
             constraints.video.mandatory.minHeight = 360;
567
             constraints.video.mandatory.minHeight = 360;
566
-            constraints.video.mandatory.minAspectRatio = 1.77;
568
+            constraints.video.optional.push({ minAspectRatio: 1.77 });
567
             break;
569
             break;
568
         case '180':
570
         case '180':
569
             constraints.video.mandatory.minWidth = 320;
571
             constraints.video.mandatory.minWidth = 320;
570
             constraints.video.mandatory.minHeight = 180;
572
             constraints.video.mandatory.minHeight = 180;
571
-            constraints.video.mandatory.minAspectRatio = 1.77;
573
+            constraints.video.optional.push({ minAspectRatio: 1.77 });
572
             break;
574
             break;
573
         // 4:3
575
         // 4:3
574
         case '960':
576
         case '960':

Loading…
취소
저장