Sfoglia il codice sorgente

Add maxFps option for requesting video

dev1
Devin Wilson 9 anni fa
parent
commit
f92df42f2f
2 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 2
    0
      doc/API.md
  2. 9
    2
      modules/RTC/RTCUtils.js

+ 2
- 0
doc/API.md Vedi File

@@ -61,6 +61,8 @@ JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
61 61
         2. resolution - the prefered resolution for the local video.
62 62
         3. cameraDeviceId - the deviceID for the video device that is going to be used
63 63
         4. micDeviceId - the deviceID for the audio device that is going to be used
64
+        5. minFps - the minimum frame rate for the video stream (passed to GUM)
65
+        6. maxFps - the maximum frame rate for the video stream (passed to GUM)
64 66
 
65 67
 * ```JitsiMeetJS.enumerateDevices(callback)``` - returns list of the available devices as a parameter to the callback function. Every device is a object with the following format:
66 68
     - label - the name of the device

+ 9
- 2
modules/RTC/RTCUtils.js Vedi File

@@ -167,14 +167,21 @@ function getConstraints(um, options) {
167 167
         }
168 168
         constraints.video.optional.push({bandwidth: options.bandwidth});
169 169
     }
170
-    if (options.fps) {
170
+
171
+    if(options.minFps || options.maxFps || options.fps) {
171 172
         // for some cameras it might be necessary to request 30fps
172 173
         // so they choose 30fps mjpg over 10fps yuy2
173 174
         if (!constraints.video) {
174 175
             // same behaviour as true;
175 176
             constraints.video = {mandatory: {}, optional: []};
176 177
         }
177
-        constraints.video.mandatory.minFrameRate = options.fps;
178
+        if(options.minFps || options.fps) {
179
+            options.minFps = options.minFps || options.fps; //Fall back to options.fps for backwards compatibility
180
+            constraints.video.mandatory.minFrameRate = options.minFps;
181
+        }
182
+        if(options.maxFps) {
183
+            constraints.video.mandatory.maxFrameRate = options.maxFps;
184
+        }
178 185
     }
179 186
 
180 187
     // we turn audio for both audio and video tracks, the fake audio & video seems to work

Loading…
Annulla
Salva