|
@@ -215,12 +215,29 @@ const ScreenObtainer = {
|
215
|
215
|
}
|
216
|
216
|
|
217
|
217
|
const { desktopSharingFrameRate } = this.options;
|
218
|
|
- const video = typeof desktopSharingFrameRate === 'object' ? { frameRate: desktopSharingFrameRate } : true;
|
|
218
|
+ const setScreenSharingResolutionConstraints = browser.isChromiumBased()
|
|
219
|
+ && this.options?.testing?.setScreenSharingResolutionConstraints;
|
|
220
|
+ let video = {};
|
|
221
|
+
|
|
222
|
+ if (typeof desktopSharingFrameRate === 'object') {
|
|
223
|
+ video.frameRate = desktopSharingFrameRate;
|
|
224
|
+ }
|
|
225
|
+ if (setScreenSharingResolutionConstraints) {
|
|
226
|
+ // Set bogus resolution constraints to work around
|
|
227
|
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=1056311
|
|
228
|
+ video.height = 99999;
|
|
229
|
+ video.width = 99999;
|
|
230
|
+ }
|
|
231
|
+
|
219
|
232
|
const audio = this._getAudioConstraints();
|
220
|
233
|
|
221
|
234
|
// At the time of this writing 'min' constraint for fps is not supported by getDisplayMedia.
|
222
|
235
|
video.frameRate && delete video.frameRate.min;
|
223
|
236
|
|
|
237
|
+ if (Object.keys(video).length === 0) {
|
|
238
|
+ video = true;
|
|
239
|
+ }
|
|
240
|
+
|
224
|
241
|
const constraints = {
|
225
|
242
|
video,
|
226
|
243
|
audio,
|