From 99da4ce7dea43ae67870acbcf708ed6479efa7cc Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Mon, 12 Dec 2022 18:04:49 -0800 Subject: [PATCH] fix(UI): Suppress error log from fullscreen button on desktop (#4823) Closes #4822 --- ui/controls.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/controls.js b/ui/controls.js index a1dd088990..bfb99abc73 100644 --- a/ui/controls.js +++ b/ui/controls.js @@ -599,7 +599,11 @@ shaka.ui.Controls = class extends shaka.util.FakeEventTarget { if (this.config_.forceLandscapeOnFullscreen && screen.orientation) { // Locking to 'landscape' should let it be either // 'landscape-primary' or 'landscape-secondary' as appropriate. - await screen.orientation.lock('landscape'); + // We ignore errors from this specific call, since it creates noise + // on desktop otherwise. + try { + await screen.orientation.lock('landscape'); + } catch (error) {} } } else { const video = /** @type {HTMLVideoElement} */(this.localVideo_);