1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Add TrueHD enabling option

This commit is contained in:
Dmitry Lyzo 2024-04-15 22:20:47 +03:00 committed by Dmitry Lyzo
parent ce15adba69
commit 275e18457e
5 changed files with 26 additions and 1 deletions

View file

@ -174,6 +174,7 @@ function loadForm(context, user, userSettings, systemInfo, apiClient) {
context.querySelector('.chkPlayDefaultAudioTrack').checked = user.Configuration.PlayDefaultAudioTrack || false; context.querySelector('.chkPlayDefaultAudioTrack').checked = user.Configuration.PlayDefaultAudioTrack || false;
context.querySelector('.chkPreferFmp4HlsContainer').checked = userSettings.preferFmp4HlsContainer(); context.querySelector('.chkPreferFmp4HlsContainer').checked = userSettings.preferFmp4HlsContainer();
context.querySelector('.chkEnableDts').checked = appSettings.enableDts(); context.querySelector('.chkEnableDts').checked = appSettings.enableDts();
context.querySelector('.chkEnableTrueHd').checked = appSettings.enableTrueHd();
context.querySelector('.chkEnableCinemaMode').checked = userSettings.enableCinemaMode(); context.querySelector('.chkEnableCinemaMode').checked = userSettings.enableCinemaMode();
context.querySelector('#selectAudioNormalization').value = userSettings.selectAudioNormalization(); context.querySelector('#selectAudioNormalization').value = userSettings.selectAudioNormalization();
context.querySelector('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay(); context.querySelector('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay();
@ -218,6 +219,7 @@ function saveUser(context, user, userSettingsInstance, apiClient) {
appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked); appSettings.limitSupportedVideoResolution(context.querySelector('.chkLimitSupportedVideoResolution').checked);
appSettings.enableDts(context.querySelector('.chkEnableDts').checked); appSettings.enableDts(context.querySelector('.chkEnableDts').checked);
appSettings.enableTrueHd(context.querySelector('.chkEnableTrueHd').checked);
setMaxBitrateFromField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video'); setMaxBitrateFromField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
setMaxBitrateFromField(context.querySelector('.selectVideoInternetQuality'), false, 'Video'); setMaxBitrateFromField(context.querySelector('.selectVideoInternetQuality'), false, 'Video');

View file

@ -165,6 +165,14 @@
</label> </label>
<div class="fieldDescription checkboxFieldDescription">${EnableDtsHelp}</div> <div class="fieldDescription checkboxFieldDescription">${EnableDtsHelp}</div>
</div> </div>
<div class="checkboxContainer checkboxContainer-withDescription fldEnableTrueHd">
<label>
<input type="checkbox" is="emby-checkbox" class="chkEnableTrueHd" />
<span>${EnableTrueHd}</span>
</label>
<div class="fieldDescription checkboxFieldDescription">${EnableTrueHdHelp}</div>
</div>
</div> </div>
<button is="emby-button" type="submit" class="raised button-submit block btnSave hide"> <button is="emby-button" type="submit" class="raised button-submit block btnSave hide">

View file

@ -562,7 +562,7 @@ export default function (options) {
videoAudioCodecs.push('pcm_s24le'); videoAudioCodecs.push('pcm_s24le');
} }
if (options.supportsTrueHd) { if (appSettings.enableTrueHd() || options.supportsTrueHd) {
videoAudioCodecs.push('truehd'); videoAudioCodecs.push('truehd');
} }

View file

@ -145,6 +145,19 @@ class AppSettings {
return toBoolean(this.get('enableDts'), false); return toBoolean(this.get('enableDts'), false);
} }
/**
* Get or set 'Enable TrueHD' state.
* @param {boolean|undefined} val - Flag to enable 'Enable TrueHD' or undefined.
* @return {boolean} 'Enable TrueHD' state.
*/
enableTrueHd(val) {
if (val !== undefined) {
return this.set('enableTrueHd', val.toString());
}
return toBoolean(this.get('enableTrueHd'), false);
}
set(name, value, userId) { set(name, value, userId) {
const currentValue = this.get(name, userId); const currentValue = this.get(name, userId);
localStorage.setItem(this.#getKey(name, userId), value); localStorage.setItem(this.#getKey(name, userId), value);

View file

@ -269,6 +269,8 @@
"EnableThemeSongsHelp": "Play the theme songs in background while browsing the library.", "EnableThemeSongsHelp": "Play the theme songs in background while browsing the library.",
"EnableThemeVideosHelp": "Play theme videos in the background while browsing the library.", "EnableThemeVideosHelp": "Play theme videos in the background while browsing the library.",
"EnableTonemapping": "Enable Tone mapping", "EnableTonemapping": "Enable Tone mapping",
"EnableTrueHd": "Enable TrueHD",
"EnableTrueHdHelp": "Only enable if your device supports TrueHD or is connected to a compatible audio receiver, otherwise it may cause playback failure.",
"EncoderPresetHelp": "Pick a faster value to improve performance, or a slower value to improve quality.", "EncoderPresetHelp": "Pick a faster value to improve performance, or a slower value to improve quality.",
"Ended": "Ended", "Ended": "Ended",
"EndsAtValue": "Ends at {0}", "EndsAtValue": "Ends at {0}",