|
|
@@ -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
|