Browse Source

fix(ScreenObtainer): make electron desktop resolution constraints configurable

master
Daniel McAssey 2 years ago
parent
commit
1d99f862c8
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      modules/RTC/ScreenObtainer.js

+ 5
- 3
modules/RTC/ScreenObtainer.js View File

128
      */
128
      */
129
     obtainScreenOnElectron(onSuccess, onFailure, options = {}) {
129
     obtainScreenOnElectron(onSuccess, onFailure, options = {}) {
130
         if (window.JitsiMeetScreenObtainer && window.JitsiMeetScreenObtainer.openDesktopPicker) {
130
         if (window.JitsiMeetScreenObtainer && window.JitsiMeetScreenObtainer.openDesktopPicker) {
131
-            const { desktopSharingFrameRate, desktopSharingSources } = this.options;
131
+            const { desktopSharingFrameRate, desktopSharingResolution, desktopSharingSources } = this.options;
132
 
132
 
133
             window.JitsiMeetScreenObtainer.openDesktopPicker(
133
             window.JitsiMeetScreenObtainer.openDesktopPicker(
134
                 {
134
                 {
170
                                     chromeMediaSourceId: streamId,
170
                                     chromeMediaSourceId: streamId,
171
                                     minFrameRate: desktopSharingFrameRate?.min ?? SS_DEFAULT_FRAME_RATE,
171
                                     minFrameRate: desktopSharingFrameRate?.min ?? SS_DEFAULT_FRAME_RATE,
172
                                     maxFrameRate: desktopSharingFrameRate?.max ?? SS_DEFAULT_FRAME_RATE,
172
                                     maxFrameRate: desktopSharingFrameRate?.max ?? SS_DEFAULT_FRAME_RATE,
173
-                                    maxWidth: window.screen.width,
174
-                                    maxHeight: window.screen.height
173
+                                    minWidth: desktopSharingResolution?.width?.min,
174
+                                    minHeight: desktopSharingResolution?.height?.min,
175
+                                    maxWidth: desktopSharingResolution?.width?.max ?? window.screen.width,
176
+                                    maxHeight: desktopSharingResolution?.height?.max ?? window.screen.height
175
                                 }
177
                                 }
176
                             }
178
                             }
177
                         };
179
                         };

Loading…
Cancel
Save