From 0dc920d3fd4ad677f9e5d52b4200165ee374ca24 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Tue, 15 Mar 2022 19:20:58 +0300 Subject: [PATCH] Limit quality settings with maximum resolution --- src/components/qualityOptions.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/qualityOptions.js b/src/components/qualityOptions.js index bdf20e279a..8c8a04f82f 100644 --- a/src/components/qualityOptions.js +++ b/src/components/qualityOptions.js @@ -1,3 +1,4 @@ +import { appHost } from '../components/apphost'; import globalize from '../scripts/globalize'; export function getVideoQualityOptions(options) { @@ -11,7 +12,8 @@ export function getVideoQualityOptions(options) { videoWidth = videoHeight * (16 / 9); } - const maxAllowedWidth = videoWidth || 4096; + const hostScreenWidth = appHost.screen()?.maxAllowedWidth || 4096; + const maxAllowedWidth = Math.min(videoWidth || hostScreenWidth, hostScreenWidth); const qualityOptions = [];