|
@@ -485,28 +485,6 @@ function getSSConstraints(options = {}) {
|
485
|
485
|
return constraints;
|
486
|
486
|
}
|
487
|
487
|
|
488
|
|
-/**
|
489
|
|
- * Generates constraints for screen sharing when using getDisplayMedia.
|
490
|
|
- * The constraints(MediaTrackConstraints) are applied to the resulting track.
|
491
|
|
- *
|
492
|
|
- * @returns {Object} - MediaTrackConstraints constraints.
|
493
|
|
- */
|
494
|
|
-function getTrackSSConstraints(options = {}) {
|
495
|
|
- // we used to set height and width in the constraints, but this can lead
|
496
|
|
- // to inconsistencies if the browser is on a lower resolution screen
|
497
|
|
- // and we share a screen with bigger resolution, so they are now not set
|
498
|
|
- const constraints = {
|
499
|
|
- frameRate: SS_DEFAULT_FRAME_RATE
|
500
|
|
- };
|
501
|
|
- const { desktopSharingFrameRate } = options;
|
502
|
|
-
|
503
|
|
- if (desktopSharingFrameRate && desktopSharingFrameRate.max) {
|
504
|
|
- constraints.frameRate = desktopSharingFrameRate.max;
|
505
|
|
- }
|
506
|
|
-
|
507
|
|
- return constraints;
|
508
|
|
-}
|
509
|
|
-
|
510
|
488
|
/**
|
511
|
489
|
* Updates the granted permissions based on the options we requested and the
|
512
|
490
|
* streams we received.
|
|
@@ -1120,8 +1098,7 @@ class RTCUtils extends Listenable {
|
1120
|
1098
|
desktopSharingSources: options.desktopSharingSources,
|
1121
|
1099
|
gumOptions: {
|
1122
|
1100
|
frameRate: options.desktopSharingFrameRate
|
1123
|
|
- },
|
1124
|
|
- trackOptions: getTrackSSConstraints(options)
|
|
1101
|
+ }
|
1125
|
1102
|
};
|
1126
|
1103
|
}
|
1127
|
1104
|
|
|
@@ -1199,8 +1176,7 @@ class RTCUtils extends Listenable {
|
1199
|
1176
|
|
1200
|
1177
|
// Leverage the helper used by {@link _newGetDesktopMedia} to
|
1201
|
1178
|
// get constraints for the desktop stream.
|
1202
|
|
- const { gumOptions, trackOptions }
|
1203
|
|
- = this._parseDesktopSharingOptions(otherOptions);
|
|
1179
|
+ const { gumOptions } = this._parseDesktopSharingOptions(otherOptions);
|
1204
|
1180
|
|
1205
|
1181
|
const constraints = {
|
1206
|
1182
|
video: {
|
|
@@ -1211,19 +1187,10 @@ class RTCUtils extends Listenable {
|
1211
|
1187
|
|
1212
|
1188
|
return this._getUserMedia(requestedDevices, constraints, timeout)
|
1213
|
1189
|
.then(stream => {
|
1214
|
|
- const track = stream && stream.getTracks()[0];
|
1215
|
|
- const applyConstrainsPromise
|
1216
|
|
- = track && track.applyConstraints
|
1217
|
|
- ? track.applyConstraints(trackOptions)
|
1218
|
|
- : Promise.resolve();
|
1219
|
|
-
|
1220
|
|
- return applyConstrainsPromise
|
1221
|
|
- .then(() => {
|
1222
|
|
- return {
|
1223
|
|
- sourceType: 'device',
|
1224
|
|
- stream
|
1225
|
|
- };
|
1226
|
|
- });
|
|
1190
|
+ return {
|
|
1191
|
+ sourceType: 'device',
|
|
1192
|
+ stream
|
|
1193
|
+ };
|
1227
|
1194
|
});
|
1228
|
1195
|
}
|
1229
|
1196
|
|