|
@@ -1222,6 +1222,15 @@ class RTCUtils extends Listenable {
|
1222
|
1222
|
device.kind === 'videoinput'
|
1223
|
1223
|
&& (device.deviceId === desktopSharingSourceDevice
|
1224
|
1224
|
|| device.label === desktopSharingSourceDevice));
|
|
1225
|
+
|
|
1226
|
+ if (!matchingDevice) {
|
|
1227
|
+ return Promise.reject(new JitsiTrackError(
|
|
1228
|
+ { name: 'ConstraintNotSatisfiedError' },
|
|
1229
|
+ {},
|
|
1230
|
+ [ desktopSharingSourceDevice ]
|
|
1231
|
+ ));
|
|
1232
|
+ }
|
|
1233
|
+
|
1225
|
1234
|
const requestedDevices = [ 'video' ];
|
1226
|
1235
|
|
1227
|
1236
|
// Leverage the helper used by {@link _newGetDesktopMedia} to
|
|
@@ -1229,17 +1238,10 @@ class RTCUtils extends Listenable {
|
1229
|
1238
|
const { gumOptions, trackOptions }
|
1230
|
1239
|
= this._parseDesktopSharingOptions(options);
|
1231
|
1240
|
|
1232
|
|
- // Create a custom constraints object to use exact device
|
1233
|
|
- // matching to make sure there is no fallthrough to another
|
1234
|
|
- // camera device. If a matching device could not be found, try
|
1235
|
|
- // anyways and let the caller handle errors.
|
1236
|
1241
|
const constraints = {
|
1237
|
1242
|
video: {
|
1238
|
1243
|
...gumOptions,
|
1239
|
|
- deviceId: {
|
1240
|
|
- exact: (matchingDevice && matchingDevice.deviceId)
|
1241
|
|
- || desktopSharingSourceDevice
|
1242
|
|
- }
|
|
1244
|
+ deviceId: matchingDevice.deviceId
|
1243
|
1245
|
}
|
1244
|
1246
|
};
|
1245
|
1247
|
|