Skip to content

Commit

Permalink
stabilise user media dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
binarykitchen committed Nov 24, 2024
1 parent ee5ac26 commit d16bbed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/util/error/VideomailError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ class VideomailError extends HTTPError {
const usefulClientData = browser.getUsefulData();

this.browser = usefulClientData.browser;
this.cpu = usefulClientData.cpu;

// Only when architecture is set, pass it over
if (usefulClientData.cpu.architecture) {
this.cpu = usefulClientData.cpu;
}
this.device = usefulClientData.device;
this.engine = usefulClientData.engine;
this.os = usefulClientData.os;
Expand Down
12 changes: 10 additions & 2 deletions src/wrappers/visuals/userMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,19 @@ class UserMedia extends Despot {
}

public getVideoHeight() {
return this.rawVisualUserMedia?.videoHeight;
if (!this.rawVisualUserMedia) {
return undefined;
}

return this.rawVisualUserMedia.videoHeight || this.rawVisualUserMedia.height;
}

public getVideoWidth() {
return this.rawVisualUserMedia?.videoWidth;
if (!this.rawVisualUserMedia) {
return undefined;
}

return this.rawVisualUserMedia.videoWidth || this.rawVisualUserMedia.width;
}

public hasVideoWidth() {
Expand Down

0 comments on commit d16bbed

Please sign in to comment.