From d16bbed1ecc71847f9e45c74878f24d747579427 Mon Sep 17 00:00:00 2001 From: Michael Heuberger Date: Sun, 24 Nov 2024 16:26:43 +1300 Subject: [PATCH] stabilise user media dimensions --- src/util/error/VideomailError.ts | 6 +++++- src/wrappers/visuals/userMedia.ts | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/util/error/VideomailError.ts b/src/util/error/VideomailError.ts index 5cadee19..098adb09 100644 --- a/src/util/error/VideomailError.ts +++ b/src/util/error/VideomailError.ts @@ -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; diff --git a/src/wrappers/visuals/userMedia.ts b/src/wrappers/visuals/userMedia.ts index 8bfa8bee..0d005b09 100644 --- a/src/wrappers/visuals/userMedia.ts +++ b/src/wrappers/visuals/userMedia.ts @@ -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() {