|
@@ -22,7 +22,8 @@ function getPreviousResolution(resolution) {
|
22
|
22
|
return resName;
|
23
|
23
|
}
|
24
|
24
|
|
25
|
|
-function setResolutionConstraints(constraints, resolution, isAndroid) {
|
|
25
|
+function setResolutionConstraints(constraints, resolution) {
|
|
26
|
+ var isAndroid = RTCBrowserType.isAndroid();
|
26
|
27
|
|
27
|
28
|
if (Resolutions[resolution]) {
|
28
|
29
|
constraints.video.mandatory.minWidth = Resolutions[resolution].width;
|
|
@@ -44,8 +45,7 @@ function setResolutionConstraints(constraints, resolution, isAndroid) {
|
44
|
45
|
constraints.video.mandatory.minHeight;
|
45
|
46
|
}
|
46
|
47
|
|
47
|
|
-function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid)
|
48
|
|
-{
|
|
48
|
+function getConstraints(um, resolution, bandwidth, fps, desktopStream) {
|
49
|
49
|
var constraints = {audio: false, video: false};
|
50
|
50
|
|
51
|
51
|
if (um.indexOf('video') >= 0) {
|
|
@@ -54,7 +54,7 @@ function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid
|
54
|
54
|
|
55
|
55
|
constraints.video.optional.push({ googLeakyBucket: true });
|
56
|
56
|
|
57
|
|
- setResolutionConstraints(constraints, resolution, isAndroid);
|
|
57
|
+ setResolutionConstraints(constraints, resolution);
|
58
|
58
|
}
|
59
|
59
|
if (um.indexOf('audio') >= 0) {
|
60
|
60
|
if (!RTCBrowserType.isFirefox()) {
|
|
@@ -209,7 +209,7 @@ function RTCUtils(RTCService, onTemasysPluginReady)
|
209
|
209
|
};
|
210
|
210
|
// DTLS should now be enabled by default but..
|
211
|
211
|
this.pc_constraints = {'optional': [{'DtlsSrtpKeyAgreement': 'true'}]};
|
212
|
|
- if (navigator.userAgent.indexOf('Android') != -1) {
|
|
212
|
+ if (RTCBrowserType.isAndroid()) {
|
213
|
213
|
this.pc_constraints = {}; // disable DTLS on Android
|
214
|
214
|
}
|
215
|
215
|
if (!webkitMediaStream.prototype.getVideoTracks) {
|
|
@@ -286,11 +286,9 @@ RTCUtils.prototype.getUserMediaWithConstraints = function(
|
286
|
286
|
um, success_callback, failure_callback, resolution,bandwidth, fps,
|
287
|
287
|
desktopStream) {
|
288
|
288
|
currentResolution = resolution;
|
289
|
|
- // Check if we are running on Android device
|
290
|
|
- var isAndroid = navigator.userAgent.indexOf('Android') != -1;
|
291
|
289
|
|
292
|
290
|
var constraints = getConstraints(
|
293
|
|
- um, resolution, bandwidth, fps, desktopStream, isAndroid);
|
|
291
|
+ um, resolution, bandwidth, fps, desktopStream);
|
294
|
292
|
|
295
|
293
|
console.info("Get media constraints", constraints);
|
296
|
294
|
|