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 d351c9e49f..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'); @@ -194,8 +195,8 @@ function loadForm(context, user, userSettings, systemInfo, apiClient) { selectChromecastVersion.innerHTML = ccAppsHtml; selectChromecastVersion.value = user.Configuration.CastReceiverId; - const selectLabelMaxVideoWidth = context.querySelector('.selectLabelMaxVideoWidth'); - selectLabelMaxVideoWidth.value = appSettings.maxVideoWidth(); + const selectMaxVideoWidth = context.querySelector('.selectMaxVideoWidth'); + selectMaxVideoWidth.value = appSettings.maxVideoWidth(); const selectSkipForwardLength = context.querySelector('.selectSkipForwardLength'); fillSkipLengths(selectSkipForwardLength); @@ -212,7 +213,8 @@ function saveUser(context, user, userSettingsInstance, apiClient) { appSettings.enableSystemExternalPlayers(context.querySelector('.chkExternalVideoPlayer').checked); appSettings.maxChromecastBitrate(context.querySelector('.selectChromecastVideoQuality').value); - appSettings.maxVideoWidth(context.querySelector('.selectLabelMaxVideoWidth').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'); @@ -309,7 +311,7 @@ function embed(options, self) { options.element.querySelector('.btnSave').classList.remove('hide'); } - options.element.querySelector('.selectLabelMaxVideoWidth').addEventListener('change', onMaxVideoWidthChange.bind(self)); + options.element.querySelector('.selectMaxVideoWidth').addEventListener('change', onMaxVideoWidthChange.bind(self)); self.loadData(); diff --git a/src/components/playbackSettings/playbackSettings.template.html b/src/components/playbackSettings/playbackSettings.template.html index 7223b7e7bb..6dc860260f 100644 --- a/src/components/playbackSettings/playbackSettings.template.html +++ b/src/components/playbackSettings/playbackSettings.template.html @@ -43,7 +43,7 @@