Procházet zdrojové kódy

Fixes GUM failure with the latest FF nightly plus cleanup.

master
paweldomas před 10 roky
rodič
revize
e5d03d1d11
1 změnil soubory, kde provedl 27 přidání a 37 odebrání
  1. 27
    37
      modules/RTC/RTCUtils.js

+ 27
- 37
modules/RTC/RTCUtils.js Zobrazit soubor

23
 }
23
 }
24
 
24
 
25
 function setResolutionConstraints(constraints, resolution, isAndroid) {
25
 function setResolutionConstraints(constraints, resolution, isAndroid) {
26
-    if (resolution && !constraints.video || isAndroid) {
27
-        // same behaviour as true
28
-        constraints.video = { mandatory: {}, optional: [] };
29
-    }
30
 
26
 
31
-    if(Resolutions[resolution]) {
27
+    if (Resolutions[resolution]) {
32
         constraints.video.mandatory.minWidth = Resolutions[resolution].width;
28
         constraints.video.mandatory.minWidth = Resolutions[resolution].width;
33
         constraints.video.mandatory.minHeight = Resolutions[resolution].height;
29
         constraints.video.mandatory.minHeight = Resolutions[resolution].height;
34
     }
30
     }
35
-    else {
36
-        if (isAndroid) {
37
-            constraints.video.mandatory.minWidth = 320;
38
-            constraints.video.mandatory.minHeight = 240;
39
-            constraints.video.mandatory.maxFrameRate = 15;
40
-        }
31
+    else if (isAndroid) {
32
+        // FIXME can't remember if the purpose of this was to always request
33
+        //       low resolution on Android ? if yes it should be moved up front
34
+        constraints.video.mandatory.minWidth = 320;
35
+        constraints.video.mandatory.minHeight = 240;
36
+        constraints.video.mandatory.maxFrameRate = 15;
41
     }
37
     }
42
 
38
 
43
     if (constraints.video.mandatory.minWidth)
39
     if (constraints.video.mandatory.minWidth)
55
     if (um.indexOf('video') >= 0) {
51
     if (um.indexOf('video') >= 0) {
56
         // same behaviour as true
52
         // same behaviour as true
57
         constraints.video = { mandatory: {}, optional: [] };
53
         constraints.video = { mandatory: {}, optional: [] };
54
+
55
+        constraints.video.optional.push({ googLeakyBucket: true });
56
+
57
+        setResolutionConstraints(constraints, resolution, isAndroid);
58
     }
58
     }
59
     if (um.indexOf('audio') >= 0) {
59
     if (um.indexOf('audio') >= 0) {
60
-        // same behaviour as true
61
-        constraints.audio = { mandatory: {}, optional: []};
60
+        if (!RTCBrowserType.isFirefox()) {
61
+            // same behaviour as true
62
+            constraints.audio = { mandatory: {}, optional: []};
63
+            // if it is good enough for hangouts...
64
+            constraints.audio.optional.push(
65
+                {googEchoCancellation: true},
66
+                {googAutoGainControl: true},
67
+                {googNoiseSupression: true},
68
+                {googHighpassFilter: true},
69
+                {googNoisesuppression2: true},
70
+                {googEchoCancellation2: true},
71
+                {googAutoGainControl2: true}
72
+            );
73
+        } else {
74
+            constraints.audio = true;
75
+        }
62
     }
76
     }
63
     if (um.indexOf('screen') >= 0) {
77
     if (um.indexOf('screen') >= 0) {
64
         if (RTCBrowserType.isChrome()) {
78
         if (RTCBrowserType.isChrome()) {
100
         };
114
         };
101
     }
115
     }
102
 
116
 
103
-    if (constraints.audio) {
104
-        // if it is good enough for hangouts...
105
-        constraints.audio.optional.push(
106
-            {googEchoCancellation: true},
107
-            {googAutoGainControl: true},
108
-            {googNoiseSupression: true},
109
-            {googHighpassFilter: true},
110
-            {googNoisesuppression2: true},
111
-            {googEchoCancellation2: true},
112
-            {googAutoGainControl2: true}
113
-        );
114
-    }
115
-    if (constraints.video) {
116
-        if (um.indexOf('video') >= 0) {
117
-            constraints.video.optional.push(
118
-                {googLeakyBucket: true}
119
-            );
120
-        }
121
-    }
122
-
123
-    if (um.indexOf('video') >= 0) {
124
-        setResolutionConstraints(constraints, resolution, isAndroid);
125
-    }
126
-
127
     if (bandwidth) {
117
     if (bandwidth) {
128
         if (!constraints.video) {
118
         if (!constraints.video) {
129
             //same behaviour as true
119
             //same behaviour as true

Načítá se…
Zrušit
Uložit