|
@@ -1326,10 +1326,10 @@ module.exports = {
|
1326
|
1326
|
/**
|
1327
|
1327
|
* Returns JitsiTrackErrors based on the error object passed by GUM
|
1328
|
1328
|
* @param error the error
|
1329
|
|
- * @param {Object} options the options object given to GUM.
|
|
1329
|
+ * @param {Array} devices Array with the requested devices
|
1330
|
1330
|
*/
|
1331
|
|
- parseError: function (error, options) {
|
1332
|
|
- options = options || {};
|
|
1331
|
+ parseError: function (error, devices) {
|
|
1332
|
+ devices = devices || [];
|
1333
|
1333
|
if (typeof error == "object" && error.constraintName && error.name
|
1334
|
1334
|
&& (error.name == "ConstraintNotSatisfiedError" ||
|
1335
|
1335
|
error.name == "OverconstrainedError") &&
|
|
@@ -1337,7 +1337,7 @@ module.exports = {
|
1337
|
1337
|
error.constraintName == "maxWidth" ||
|
1338
|
1338
|
error.constraintName == "minHeight" ||
|
1339
|
1339
|
error.constraintName == "maxHeight") &&
|
1340
|
|
- options.devices.indexOf("video") !== -1) {
|
|
1340
|
+ devices.indexOf("video") !== -1) {
|
1341
|
1341
|
return this.UNSUPPORTED_RESOLUTION;
|
1342
|
1342
|
} else {
|
1343
|
1343
|
return this.GENERAL;
|
|
@@ -2857,6 +2857,8 @@ function obtainDevices(options) {
|
2857
|
2857
|
}
|
2858
|
2858
|
|
2859
|
2859
|
var device = options.devices.splice(0, 1);
|
|
2860
|
+ var devices = [];
|
|
2861
|
+ devices.push(device);
|
2860
|
2862
|
options.deviceGUM[device](function (stream) {
|
2861
|
2863
|
options.streams = options.streams || {};
|
2862
|
2864
|
options.streams[device] = stream;
|
|
@@ -2865,7 +2867,7 @@ function obtainDevices(options) {
|
2865
|
2867
|
function (error) {
|
2866
|
2868
|
logger.error(
|
2867
|
2869
|
"failed to obtain " + device + " stream - stop", error);
|
2868
|
|
- options.errorCallback(JitsiTrackErrors.parseError(error));
|
|
2870
|
+ options.errorCallback(JitsiTrackErrors.parseError(error, devices));
|
2869
|
2871
|
});
|
2870
|
2872
|
}
|
2871
|
2873
|
|
|
@@ -3213,14 +3215,16 @@ var RTCUtils = {
|
3213
|
3215
|
desktopStream: desktopStream});
|
3214
|
3216
|
}, function (error) {
|
3215
|
3217
|
reject(
|
3216
|
|
- JitsiTrackErrors.parseError(error));
|
|
3218
|
+ JitsiTrackErrors.parseError(error,
|
|
3219
|
+ options.devices));
|
3217
|
3220
|
});
|
3218
|
3221
|
} else {
|
3219
|
3222
|
successCallback({audioVideo: stream});
|
3220
|
3223
|
}
|
3221
|
3224
|
},
|
3222
|
3225
|
function (error) {
|
3223
|
|
- reject(JitsiTrackErrors.parseError(error));
|
|
3226
|
+ reject(JitsiTrackErrors.parseError(error,
|
|
3227
|
+ options.devices));
|
3224
|
3228
|
},
|
3225
|
3229
|
options);
|
3226
|
3230
|
} else if (hasDesktop) {
|
|
@@ -3229,7 +3233,8 @@ var RTCUtils = {
|
3229
|
3233
|
successCallback({desktopStream: stream});
|
3230
|
3234
|
}, function (error) {
|
3231
|
3235
|
reject(
|
3232
|
|
- JitsiTrackErrors.parseError(error));
|
|
3236
|
+ JitsiTrackErrors.parseError(error,
|
|
3237
|
+ ["desktop"]));
|
3233
|
3238
|
});
|
3234
|
3239
|
}
|
3235
|
3240
|
}
|