Skip to content

Commit

Permalink
[mirotalksfu] - set max frame rate on default
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed Jul 15, 2022
1 parent 66041ea commit 3dfd435
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions public/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ const showFileShareBtn = true;
const showMySettingsBtn = true;
const showAboutBtn = true;

// force the webCam to max resolution, up to 4k as default
const forceCamMaxResolution = true;
// force the webCam to max resolution, up to 4k and 60fps as default (high bandwidth are required)
const forceCamMaxResolutionAndFps = true;

/**
* Load all Html elements by Id
Expand Down Expand Up @@ -2821,6 +2821,7 @@ function getAudioVideoConstraints() {

/**
* Get video constraints: https://webrtc.github.io/samples/src/content/getusermedia/resolution/
* WebCam resolution: https://webcamtests.com/resolution
* @param {string} videoQuality desired video quality
* @returns {object} video constraints
*/
Expand All @@ -2829,12 +2830,12 @@ function getVideoConstraints(videoQuality) {

switch (videoQuality) {
case 'default':
if (forceCamMaxResolution) {
// This will make the browser use the maximum resolution available as default, `up to 4K`.
if (forceCamMaxResolutionAndFps) {
// This will make the browser use the maximum resolution available as default, `up to 4K and 60fps`.
return {
width: { ideal: 3840 },
height: { ideal: 2160 },
frameRate: frameRate,
frameRate: { ideal: 60 },
}; // video cam constraints default
}
return { frameRate: frameRate };
Expand Down

0 comments on commit 3dfd435

Please sign in to comment.