|
|
@@ -29,7 +29,8 @@ function getPreviousResolution(resolution) {
|
|
29
|
29
|
return resName;
|
|
30
|
30
|
}
|
|
31
|
31
|
|
|
32
|
|
-function setResolutionConstraints(constraints, resolution, isAndroid) {
|
|
|
32
|
+function setResolutionConstraints(constraints, resolution) {
|
|
|
33
|
+ var isAndroid = RTCBrowserType.isAndroid();
|
|
33
|
34
|
|
|
34
|
35
|
if (Resolutions[resolution]) {
|
|
35
|
36
|
constraints.video.mandatory.minWidth = Resolutions[resolution].width;
|
|
|
@@ -51,8 +52,7 @@ function setResolutionConstraints(constraints, resolution, isAndroid) {
|
|
51
|
52
|
constraints.video.mandatory.minHeight;
|
|
52
|
53
|
}
|
|
53
|
54
|
|
|
54
|
|
-function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid)
|
|
55
|
|
-{
|
|
|
55
|
+function getConstraints(um, resolution, bandwidth, fps, desktopStream) {
|
|
56
|
56
|
var constraints = {audio: false, video: false};
|
|
57
|
57
|
|
|
58
|
58
|
if (um.indexOf('video') >= 0) {
|
|
|
@@ -61,7 +61,7 @@ function getConstraints(um, resolution, bandwidth, fps, desktopStream, isAndroid
|
|
61
|
61
|
|
|
62
|
62
|
constraints.video.optional.push({ googLeakyBucket: true });
|
|
63
|
63
|
|
|
64
|
|
- setResolutionConstraints(constraints, resolution, isAndroid);
|
|
|
64
|
+ setResolutionConstraints(constraints, resolution);
|
|
65
|
65
|
}
|
|
66
|
66
|
if (um.indexOf('audio') >= 0) {
|
|
67
|
67
|
if (!RTCBrowserType.isFirefox()) {
|
|
|
@@ -222,7 +222,7 @@ var RTCUtils = {
|
|
222
|
222
|
// https://code.google.com/p/webrtc/issues/detail?id=2828
|
|
223
|
223
|
this.pc_constraints.optional.push({googIPv6: true});
|
|
224
|
224
|
}
|
|
225
|
|
- if (navigator.userAgent.indexOf('Android') != -1) {
|
|
|
225
|
+ if (RTCBrowserType.isAndroid()) {
|
|
226
|
226
|
this.pc_constraints = {}; // disable DTLS on Android
|
|
227
|
227
|
}
|
|
228
|
228
|
if (!webkitMediaStream.prototype.getVideoTracks) {
|
|
|
@@ -298,11 +298,8 @@ var RTCUtils = {
|
|
298
|
298
|
|
|
299
|
299
|
|
|
300
|
300
|
getUserMediaWithConstraints: function (RTC, um, success_callback, failure_callback, resolution, bandwidth, fps, desktopStream) {
|
|
301
|
|
- // Check if we are running on Android device
|
|
302
|
|
- var isAndroid = navigator.userAgent.indexOf('Android') != -1;
|
|
303
|
|
-
|
|
304
|
301
|
var constraints = getConstraints(
|
|
305
|
|
- um, resolution, bandwidth, fps, desktopStream, isAndroid);
|
|
|
302
|
+ um, resolution, bandwidth, fps, desktopStream);
|
|
306
|
303
|
|
|
307
|
304
|
console.info("Get media constraints", constraints);
|
|
308
|
305
|
|