Browse Source

secret sauce GUM flags

j8
Philipp Hancke 11 years ago
parent
commit
794296198c
1 changed files with 27 additions and 4 deletions
  1. 27
    4
      libs/strophe/strophe.jingle.adapter.js

+ 27
- 4
libs/strophe/strophe.jingle.adapter.js View File

513
         constraints.video = { mandatory: {}, optional: [] };// 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 = { mandatory: {}, optional: []};// same behaviour as true
517
     }
517
     }
518
     if (um.indexOf('screen') >= 0) {
518
     if (um.indexOf('screen') >= 0) {
519
         constraints.video = {
519
         constraints.video = {
541
         }
541
         }
542
     }
542
     }
543
 
543
 
544
+    if (constraints.audio) {
545
+        // if it is good enough for hangouts...
546
+        constraints.audio.optional.push(
547
+            {googEchoCancellation: true},
548
+            {googAutoGainControl: true},
549
+            {googNoiseSupression: true},
550
+            {googHighpassFilter: true},
551
+            {googNoisesuppression2: true},
552
+            {googEchoCancellation2: true},
553
+            {googAutoGainControl2: true}
554
+        );
555
+    }
556
+    if (constraints.video) {
557
+        constraints.video.optional.push(
558
+            {googNoiseReduction: true}
559
+        );
560
+        if (um.indexOf('video') >= 0) {
561
+            constraints.video.optional.push(
562
+                {googLeakyBucket: true}
563
+            );
564
+        }
565
+    }
566
+
544
     // Check if we are running on Android device
567
     // Check if we are running on Android device
545
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
568
     var isAndroid = navigator.userAgent.indexOf('Android') != -1;
546
 
569
 
596
     }
619
     }
597
 
620
 
598
     if (bandwidth) { // doesn't work currently, see webrtc issue 1846
621
     if (bandwidth) { // doesn't work currently, see webrtc issue 1846
599
-        if (!constraints.video) constraints.video = {mandatory: {}};//same behaviour as true
600
-        constraints.video.optional = [{bandwidth: bandwidth}];
622
+        if (!constraints.video) constraints.video = {mandatory: {}, optional: []};//same behaviour as true
623
+        constraints.video.optional.push({bandwidth: bandwidth});
601
     }
624
     }
602
     if (fps) { // for some cameras it might be necessary to request 30fps
625
     if (fps) { // for some cameras it might be necessary to request 30fps
603
         // so they choose 30fps mjpg over 10fps yuy2
626
         // so they choose 30fps mjpg over 10fps yuy2
604
-        if (!constraints.video) constraints.video = {mandatory: {}};// same behaviour as tru;
627
+        if (!constraints.video) constraints.video = {mandatory: {}, optional: []};// same behaviour as true;
605
         constraints.video.mandatory.minFrameRate = fps;
628
         constraints.video.mandatory.minFrameRate = fps;
606
     }
629
     }
607
 
630
 

Loading…
Cancel
Save