Skip to content

Commit 8971ee5

Browse files
authored
Merge pull request #18740 from nextcloud/backport/18736/stable34
[stable34] fix(call): apply softer resolution constraints to camera
2 parents 912b777 + 9d37d92 commit 8971ee5

1 file changed

Lines changed: 28 additions & 4 deletions

File tree

src/utils/webrtc/VideoConstrainer.js

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ VideoConstrainer.prototype = {
8686
// Quality may not actually match the default constraints, but it is the
8787
// best that can be done.
8888
this._currentQuality = quality
89+
90+
this._logAppliedSettings(quality)
91+
},
92+
93+
_logAppliedSettings(quality) {
94+
const outputTrack = this._trackConstrainer.getOutputTrack()
95+
if (!outputTrack || !outputTrack.getSettings) {
96+
return
97+
}
98+
99+
const { width, height, frameRate } = outputTrack.getSettings()
100+
console.debug('Camera picked resolution for quality %d: %dx%d @ %s fps', quality, width, height, frameRate)
89101
},
90102

91103
async _applyRoughConstraints(trackConstrainer, quality) {
@@ -169,10 +181,14 @@ VideoConstrainer.prototype = {
169181
if (quality === QUALITY.HIGH) {
170182
return {
171183
width: {
172-
min: 1440,
184+
max: 1920,
185+
ideal: 1920,
186+
min: 1280,
173187
},
174188
height: {
175-
min: 1080,
189+
max: 1080,
190+
ideal: 1080,
191+
min: 720,
176192
},
177193
frameRate: {
178194
max: 30,
@@ -186,10 +202,14 @@ VideoConstrainer.prototype = {
186202
if (quality === QUALITY.MEDIUM) {
187203
return {
188204
width: {
189-
min: 720,
205+
max: 1280,
206+
ideal: 1280,
207+
min: 640,
190208
},
191209
height: {
192-
min: 540,
210+
max: 720,
211+
ideal: 720,
212+
min: 480,
193213
},
194214
frameRate: {
195215
max: 30,
@@ -245,9 +265,13 @@ VideoConstrainer.prototype = {
245265
return {
246266
width: {
247267
max: 320,
268+
ideal: 240,
269+
min: 160,
248270
},
249271
height: {
250272
max: 240,
273+
ideal: 180,
274+
min: 120,
251275
},
252276
frameRate: {
253277
max: 30,

0 commit comments

Comments
 (0)