Skip to content

Commit d16bbed

Browse files
committed
stabilise user media dimensions
1 parent ee5ac26 commit d16bbed

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/util/error/VideomailError.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ class VideomailError extends HTTPError {
6161
const usefulClientData = browser.getUsefulData();
6262

6363
this.browser = usefulClientData.browser;
64-
this.cpu = usefulClientData.cpu;
64+
65+
// Only when architecture is set, pass it over
66+
if (usefulClientData.cpu.architecture) {
67+
this.cpu = usefulClientData.cpu;
68+
}
6569
this.device = usefulClientData.device;
6670
this.engine = usefulClientData.engine;
6771
this.os = usefulClientData.os;

src/wrappers/visuals/userMedia.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,19 @@ class UserMedia extends Despot {
391391
}
392392

393393
public getVideoHeight() {
394-
return this.rawVisualUserMedia?.videoHeight;
394+
if (!this.rawVisualUserMedia) {
395+
return undefined;
396+
}
397+
398+
return this.rawVisualUserMedia.videoHeight || this.rawVisualUserMedia.height;
395399
}
396400

397401
public getVideoWidth() {
398-
return this.rawVisualUserMedia?.videoWidth;
402+
if (!this.rawVisualUserMedia) {
403+
return undefined;
404+
}
405+
406+
return this.rawVisualUserMedia.videoWidth || this.rawVisualUserMedia.width;
399407
}
400408

401409
public hasVideoWidth() {

0 commit comments

Comments
 (0)