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 {
|
} else {
|
||||||
|
if (item.AlbumId != null) {
|
||||||
|
return apiClient.getItem(apiClient.getCurrentUserId(), item.AlbumId).then(function(result) {
|
||||||
|
mediaSource.albumLUFS = result.LUFS;
|
||||||
|
return mediaSource;
|
||||||
|
});
|
||||||
|
}
|
||||||
return mediaSource;
|
return mediaSource;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -173,7 +173,7 @@ function loadForm(context, user, userSettings, 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('.chkEnableCinemaMode').checked = userSettings.enableCinemaMode();
|
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('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay();
|
||||||
context.querySelector('.chkRememberAudioSelections').checked = user.Configuration.RememberAudioSelections || false;
|
context.querySelector('.chkRememberAudioSelections').checked = user.Configuration.RememberAudioSelections || false;
|
||||||
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || 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;
|
user.Configuration.EnableNextEpisodeAutoPlay = context.querySelector('.chkEpisodeAutoPlay').checked;
|
||||||
userSettingsInstance.preferFmp4HlsContainer(context.querySelector('.chkPreferFmp4HlsContainer').checked);
|
userSettingsInstance.preferFmp4HlsContainer(context.querySelector('.chkPreferFmp4HlsContainer').checked);
|
||||||
userSettingsInstance.enableCinemaMode(context.querySelector('.chkEnableCinemaMode').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);
|
userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector('.chkEnableNextVideoOverlay').checked);
|
||||||
user.Configuration.RememberAudioSelections = context.querySelector('.chkRememberAudioSelections').checked;
|
user.Configuration.RememberAudioSelections = context.querySelector('.chkRememberAudioSelections').checked;
|
||||||
user.Configuration.RememberSubtitleSelections = context.querySelector('.chkRememberSubtitleSelections').checked;
|
user.Configuration.RememberSubtitleSelections = context.querySelector('.chkRememberSubtitleSelections').checked;
|
||||||
|
|
|
@ -72,12 +72,13 @@
|
||||||
${TabAdvanced}
|
${TabAdvanced}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
<div class="selectContainer">
|
||||||
<label>
|
<select is="emby-select" id="selectAudioNormalization" label="${LabelSelectAudioNormalization}">
|
||||||
<input type="checkbox" is="emby-checkbox" class="chkEnableAudioNormalization" />
|
<option value="Off">${Off}</option>
|
||||||
<span>${EnableAudioNormalization}</span>
|
<option value="TrackGain">${LabelTrackGain}</option>
|
||||||
</label>
|
<option value="AlbumGain">${LabelAlbumGain}</option>
|
||||||
<div class="fieldDescription checkboxFieldDescription">${EnableAudioNormalizationHelp}</div>
|
</select>
|
||||||
|
<div class="fieldDescription">${SelectAudioNormalizationHelp}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||||
|
|
|
@ -112,9 +112,14 @@ class HtmlAudioPlayer {
|
||||||
let val = options.url;
|
let val = options.url;
|
||||||
console.debug('playing url: ' + val);
|
console.debug('playing url: ' + val);
|
||||||
import('../../scripts/settings/userSettings').then((userSettings) => {
|
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;
|
const dbGain = -18 - options.item.LUFS;
|
||||||
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
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 {
|
} else {
|
||||||
self.gainNode.gain.value = 1;
|
self.gainNode.gain.value = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,15 +158,15 @@ export class UserSettings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get or set 'Enable Audio Normalization' state.
|
* Get or set 'Enable Audio Normalization' state.
|
||||||
* @param {boolean|undefined} val - Flag to enable 'Enable Audio Normalization' or undefined.
|
* @param {string|undefined} val - Flag to enable 'Enable Audio Normalization' or undefined.
|
||||||
* @return {boolean} 'Enable Audio Normalization' state.
|
* @return {string} 'Enable Audio Normalization' state.
|
||||||
*/
|
*/
|
||||||
enableAudioNormalization(val) {
|
selectAudioNormalization(val) {
|
||||||
if (val !== undefined) {
|
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 allowedAudioChannels = currentSettings.allowedAudioChannels.bind(currentSettings);
|
||||||
export const preferFmp4HlsContainer = currentSettings.preferFmp4HlsContainer.bind(currentSettings);
|
export const preferFmp4HlsContainer = currentSettings.preferFmp4HlsContainer.bind(currentSettings);
|
||||||
export const enableCinemaMode = currentSettings.enableCinemaMode.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 enableNextVideoInfoOverlay = currentSettings.enableNextVideoInfoOverlay.bind(currentSettings);
|
||||||
export const enableVideoRemainingTime = currentSettings.enableVideoRemainingTime.bind(currentSettings);
|
export const enableVideoRemainingTime = currentSettings.enableVideoRemainingTime.bind(currentSettings);
|
||||||
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);
|
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);
|
||||||
|
|
|
@ -138,7 +138,7 @@
|
||||||
"ChannelNumber": "Channel number",
|
"ChannelNumber": "Channel number",
|
||||||
"Channels": "Channels",
|
"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.",
|
"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",
|
"ClearQueue": "Clear queue",
|
||||||
"ClientSettings": "Client Settings",
|
"ClientSettings": "Client Settings",
|
||||||
"Collections": "Collections",
|
"Collections": "Collections",
|
||||||
|
@ -226,7 +226,6 @@
|
||||||
"EnableBlurHash": "Enable blurred placeholders for images",
|
"EnableBlurHash": "Enable blurred placeholders for images",
|
||||||
"EnableBlurHashHelp": "Images that are still being loaded will be displayed with a unique placeholder.",
|
"EnableBlurHashHelp": "Images that are still being loaded will be displayed with a unique placeholder.",
|
||||||
"EnableCinemaMode": "Cinema mode",
|
"EnableCinemaMode": "Cinema mode",
|
||||||
"EnableAudioNormalization": "Audio Normalization",
|
|
||||||
"EnableColorCodedBackgrounds": "Color coded backgrounds",
|
"EnableColorCodedBackgrounds": "Color coded backgrounds",
|
||||||
"EnableDecodingColorDepth10Hevc": "Enable 10-bit hardware decoding for HEVC",
|
"EnableDecodingColorDepth10Hevc": "Enable 10-bit hardware decoding for HEVC",
|
||||||
"EnableDecodingColorDepth10Vp9": "Enable 10-bit hardware decoding for VP9",
|
"EnableDecodingColorDepth10Vp9": "Enable 10-bit hardware decoding for VP9",
|
||||||
|
@ -549,6 +548,7 @@
|
||||||
"LabelAlbumArtMaxResHelp": "Maximum resolution of album art exposed via the 'upnp:albumArtURI' property.",
|
"LabelAlbumArtMaxResHelp": "Maximum resolution of album art exposed via the 'upnp:albumArtURI' property.",
|
||||||
"LabelAlbumArtMaxWidth": "Album art max width",
|
"LabelAlbumArtMaxWidth": "Album art max width",
|
||||||
"LabelAlbumArtPN": "Album art PN",
|
"LabelAlbumArtPN": "Album art PN",
|
||||||
|
"LabelAlbumGain": "Album Gain",
|
||||||
"LabelAllowedRemoteAddresses": "Remote IP address filter",
|
"LabelAllowedRemoteAddresses": "Remote IP address filter",
|
||||||
"LabelAllowedRemoteAddressesMode": "Remote IP address filter mode",
|
"LabelAllowedRemoteAddressesMode": "Remote IP address filter mode",
|
||||||
"LabelAllowHWTranscoding": "Allow hardware transcoding",
|
"LabelAllowHWTranscoding": "Allow hardware transcoding",
|
||||||
|
@ -561,6 +561,7 @@
|
||||||
"LabelAudioChannels": "Audio channels",
|
"LabelAudioChannels": "Audio channels",
|
||||||
"LabelAudioCodec": "Audio codec",
|
"LabelAudioCodec": "Audio codec",
|
||||||
"LabelAudioLanguagePreference": "Preferred audio language",
|
"LabelAudioLanguagePreference": "Preferred audio language",
|
||||||
|
"LabelSelectAudioNormalization": "Audio Normalization",
|
||||||
"LabelAudioSampleRate": "Audio sample rate",
|
"LabelAudioSampleRate": "Audio sample rate",
|
||||||
"LabelAuthProvider": "Authentication Provider",
|
"LabelAuthProvider": "Authentication Provider",
|
||||||
"LabelAutomaticallyAddToCollection": "Automatically add to collection",
|
"LabelAutomaticallyAddToCollection": "Automatically add to collection",
|
||||||
|
@ -1635,6 +1636,7 @@
|
||||||
"LabelPlaybackInfo": "Playback Info",
|
"LabelPlaybackInfo": "Playback Info",
|
||||||
"LabelAudioInfo": "Audio Info",
|
"LabelAudioInfo": "Audio Info",
|
||||||
"LabelVideoInfo": "Video Info",
|
"LabelVideoInfo": "Video Info",
|
||||||
|
"LabelTrackGain": "Track Gain",
|
||||||
"LabelTranscodingInfo": "Transcoding Info",
|
"LabelTranscodingInfo": "Transcoding Info",
|
||||||
"LabelDirectStreamingInfo": "Direct Streaming Info",
|
"LabelDirectStreamingInfo": "Direct Streaming Info",
|
||||||
"LabelRemuxingInfo": "Remuxing Info",
|
"LabelRemuxingInfo": "Remuxing Info",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue