diff --git a/src/components/apphost.js b/src/components/apphost.js index 8df5884bb1..742476195d 100644 --- a/src/components/apphost.js +++ b/src/components/apphost.js @@ -45,18 +45,27 @@ function getDeviceProfile(item) { const maxTranscodingVideoWidth = maxVideoWidth < 0 ? appHost.screen()?.maxAllowedWidth : maxVideoWidth; if (maxTranscodingVideoWidth) { + const conditionWidth = { + Condition: 'LessThanEqual', + Property: 'Width', + Value: maxTranscodingVideoWidth.toString(), + IsRequired: false + }; + + if (appSettings.limitSupportedVideoResolution()) { + profile.CodecProfiles.push({ + Type: 'Video', + Conditions: [conditionWidth] + }); + } + profile.TranscodingProfiles.forEach((transcodingProfile) => { if (transcodingProfile.Type === 'Video') { transcodingProfile.Conditions = (transcodingProfile.Conditions || []).filter((condition) => { return condition.Property !== 'Width'; }); - transcodingProfile.Conditions.push({ - Condition: 'LessThanEqual', - Property: 'Width', - Value: maxTranscodingVideoWidth.toString(), - IsRequired: false - }); + transcodingProfile.Conditions.push(conditionWidth); } }); } diff --git a/src/components/playbackSettings/playbackSettings.js b/src/components/playbackSettings/playbackSettings.js index 51e36d13aa..254389a9f6 100644 --- a/src/components/playbackSettings/playbackSettings.js +++ b/src/components/playbackSettings/playbackSettings.js @@ -179,6 +179,7 @@ function loadForm(context, user, userSettings, systemInfo, apiClient) { context.querySelector('.chkRememberAudioSelections').checked = user.Configuration.RememberAudioSelections || false; context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false; context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers(); + context.querySelector('.chkLimitSupportedVideoResolution').checked = appSettings.limitSupportedVideoResolution(); setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video'); setMaxBitrateIntoField(context.querySelector('.selectVideoInternetQuality'), false, 'Video'); @@ -213,6 +214,7 @@ function saveUser(context, user, userSettingsInstance, apiClient) { appSettings.maxChromecastBitrate(context.querySelector('.selectChromecastVideoQuality').value); appSettings.maxVideoWidth(context.querySelector('.selectMaxVideoWidth').value); + appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked); setMaxBitrateFromField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video'); setMaxBitrateFromField(context.querySelector('.selectVideoInternetQuality'), false, 'Video'); diff --git a/src/components/playbackSettings/playbackSettings.template.html b/src/components/playbackSettings/playbackSettings.template.html index 4b9c9a0a5f..6dc860260f 100644 --- a/src/components/playbackSettings/playbackSettings.template.html +++ b/src/components/playbackSettings/playbackSettings.template.html @@ -54,6 +54,14 @@ + +