mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
c2ec479567
6 changed files with 31 additions and 17 deletions
|
@ -2774,6 +2774,12 @@ class PlaybackManager {
|
|||
});
|
||||
});
|
||||
} else {
|
||||
if (item.AlbumId != null) {
|
||||
return apiClient.getItem(apiClient.getCurrentUserId(), item.AlbumId).then(function(result) {
|
||||
mediaSource.albumLUFS = result.LUFS;
|
||||
return mediaSource;
|
||||
});
|
||||
}
|
||||
return mediaSource;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -173,7 +173,7 @@ function loadForm(context, user, userSettings, apiClient) {
|
|||
context.querySelector('.chkPlayDefaultAudioTrack').checked = user.Configuration.PlayDefaultAudioTrack || false;
|
||||
context.querySelector('.chkPreferFmp4HlsContainer').checked = userSettings.preferFmp4HlsContainer();
|
||||
context.querySelector('.chkEnableCinemaMode').checked = userSettings.enableCinemaMode();
|
||||
context.querySelector('.chkEnableAudioNormalization').checked = userSettings.enableAudioNormalization();
|
||||
context.querySelector('#selectAudioNormalization').value = userSettings.selectAudioNormalization();
|
||||
context.querySelector('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay();
|
||||
context.querySelector('.chkRememberAudioSelections').checked = user.Configuration.RememberAudioSelections || false;
|
||||
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false;
|
||||
|
@ -218,7 +218,7 @@ function saveUser(context, user, userSettingsInstance, apiClient) {
|
|||
user.Configuration.EnableNextEpisodeAutoPlay = context.querySelector('.chkEpisodeAutoPlay').checked;
|
||||
userSettingsInstance.preferFmp4HlsContainer(context.querySelector('.chkPreferFmp4HlsContainer').checked);
|
||||
userSettingsInstance.enableCinemaMode(context.querySelector('.chkEnableCinemaMode').checked);
|
||||
userSettingsInstance.enableAudioNormalization(context.querySelector('.chkEnableAudioNormalization').checked);
|
||||
userSettingsInstance.selectAudioNormalization(context.querySelector('#selectAudioNormalization').value);
|
||||
userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector('.chkEnableNextVideoOverlay').checked);
|
||||
user.Configuration.RememberAudioSelections = context.querySelector('.chkRememberAudioSelections').checked;
|
||||
user.Configuration.RememberSubtitleSelections = context.querySelector('.chkRememberSubtitleSelections').checked;
|
||||
|
|
|
@ -72,12 +72,13 @@
|
|||
${TabAdvanced}
|
||||
</h2>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkEnableAudioNormalization" />
|
||||
<span>${EnableAudioNormalization}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${EnableAudioNormalizationHelp}</div>
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectAudioNormalization" label="${LabelSelectAudioNormalization}">
|
||||
<option value="Off">${Off}</option>
|
||||
<option value="TrackGain">${LabelTrackGain}</option>
|
||||
<option value="AlbumGain">${LabelAlbumGain}</option>
|
||||
</select>
|
||||
<div class="fieldDescription">${SelectAudioNormalizationHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||
|
|
|
@ -112,9 +112,14 @@ class HtmlAudioPlayer {
|
|||
let val = options.url;
|
||||
console.debug('playing url: ' + val);
|
||||
import('../../scripts/settings/userSettings').then((userSettings) => {
|
||||
if (userSettings.enableAudioNormalization() && options.item.LUFS != null) {
|
||||
if (userSettings.selectAudioNormalization() == 'TrackGain' && options.item.LUFS != null) {
|
||||
const dbGain = -18 - options.item.LUFS;
|
||||
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
||||
console.debug('[HtmlAudioPlayer] Using track gain');
|
||||
} else if (userSettings.selectAudioNormalization() == 'AlbumGain' && options.mediaSource.albumLUFS != null) {
|
||||
const dbGain = -18 - options.mediaSource.albumLUFS;
|
||||
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
||||
console.debug('[HtmlAudioPlayer] Using album gain');
|
||||
} else {
|
||||
self.gainNode.gain.value = 1;
|
||||
}
|
||||
|
|
|
@ -158,15 +158,15 @@ export class UserSettings {
|
|||
|
||||
/**
|
||||
* Get or set 'Enable Audio Normalization' state.
|
||||
* @param {boolean|undefined} val - Flag to enable 'Enable Audio Normalization' or undefined.
|
||||
* @return {boolean} 'Enable Audio Normalization' state.
|
||||
* @param {string|undefined} val - Flag to enable 'Enable Audio Normalization' or undefined.
|
||||
* @return {string} 'Enable Audio Normalization' state.
|
||||
*/
|
||||
enableAudioNormalization(val) {
|
||||
selectAudioNormalization(val) {
|
||||
if (val !== undefined) {
|
||||
return this.set('enableAudioNormalization', val.toString(), false);
|
||||
return this.set('selectAudioNormalization', val, false);
|
||||
}
|
||||
|
||||
return toBoolean(this.get('enableAudioNormalization', false), true);
|
||||
return this.get('selectAudioNormalization', false) || 'TrackGain';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -651,7 +651,7 @@ export const serverConfig = currentSettings.serverConfig.bind(currentSettings);
|
|||
export const allowedAudioChannels = currentSettings.allowedAudioChannels.bind(currentSettings);
|
||||
export const preferFmp4HlsContainer = currentSettings.preferFmp4HlsContainer.bind(currentSettings);
|
||||
export const enableCinemaMode = currentSettings.enableCinemaMode.bind(currentSettings);
|
||||
export const enableAudioNormalization = currentSettings.enableAudioNormalization.bind(currentSettings);
|
||||
export const selectAudioNormalization = currentSettings.selectAudioNormalization.bind(currentSettings);
|
||||
export const enableNextVideoInfoOverlay = currentSettings.enableNextVideoInfoOverlay.bind(currentSettings);
|
||||
export const enableVideoRemainingTime = currentSettings.enableVideoRemainingTime.bind(currentSettings);
|
||||
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
"ChannelNumber": "Channel number",
|
||||
"Channels": "Channels",
|
||||
"CinemaModeConfigurationHelp": "Cinema mode brings the theater experience straight to your living room with the ability to play trailers and custom intros before the main feature.",
|
||||
"EnableAudioNormalizationHelp": "Audio normalization will add a constant gain to keep the average at a desired level (-18dB).",
|
||||
"SelectAudioNormalizationHelp": "Track gain - adjusts the volume of each track so they playback with the same loudness. Album gain - adjusts the volume of all the tracks in an album only, keeping the album's dynamic range.",
|
||||
"ClearQueue": "Clear queue",
|
||||
"ClientSettings": "Client Settings",
|
||||
"Collections": "Collections",
|
||||
|
@ -226,7 +226,6 @@
|
|||
"EnableBlurHash": "Enable blurred placeholders for images",
|
||||
"EnableBlurHashHelp": "Images that are still being loaded will be displayed with a unique placeholder.",
|
||||
"EnableCinemaMode": "Cinema mode",
|
||||
"EnableAudioNormalization": "Audio Normalization",
|
||||
"EnableColorCodedBackgrounds": "Color coded backgrounds",
|
||||
"EnableDecodingColorDepth10Hevc": "Enable 10-bit hardware decoding for HEVC",
|
||||
"EnableDecodingColorDepth10Vp9": "Enable 10-bit hardware decoding for VP9",
|
||||
|
@ -549,6 +548,7 @@
|
|||
"LabelAlbumArtMaxResHelp": "Maximum resolution of album art exposed via the 'upnp:albumArtURI' property.",
|
||||
"LabelAlbumArtMaxWidth": "Album art max width",
|
||||
"LabelAlbumArtPN": "Album art PN",
|
||||
"LabelAlbumGain": "Album Gain",
|
||||
"LabelAllowedRemoteAddresses": "Remote IP address filter",
|
||||
"LabelAllowedRemoteAddressesMode": "Remote IP address filter mode",
|
||||
"LabelAllowHWTranscoding": "Allow hardware transcoding",
|
||||
|
@ -561,6 +561,7 @@
|
|||
"LabelAudioChannels": "Audio channels",
|
||||
"LabelAudioCodec": "Audio codec",
|
||||
"LabelAudioLanguagePreference": "Preferred audio language",
|
||||
"LabelSelectAudioNormalization": "Audio Normalization",
|
||||
"LabelAudioSampleRate": "Audio sample rate",
|
||||
"LabelAuthProvider": "Authentication Provider",
|
||||
"LabelAutomaticallyAddToCollection": "Automatically add to collection",
|
||||
|
@ -1635,6 +1636,7 @@
|
|||
"LabelPlaybackInfo": "Playback Info",
|
||||
"LabelAudioInfo": "Audio Info",
|
||||
"LabelVideoInfo": "Video Info",
|
||||
"LabelTrackGain": "Track Gain",
|
||||
"LabelTranscodingInfo": "Transcoding Info",
|
||||
"LabelDirectStreamingInfo": "Direct Streaming Info",
|
||||
"LabelRemuxingInfo": "Remuxing Info",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue