mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Tidy code
This commit is contained in:
parent
6f0fb8c0ce
commit
ba6db57913
3 changed files with 8 additions and 15 deletions
|
@ -233,8 +233,6 @@ import template from './playbackSettings.template.html';
|
||||||
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.enableAudioNormalization(context.querySelector('.chkEnableAudioNormalization').checked);
|
||||||
|
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -4,7 +4,6 @@ import * as htmlMediaHelper from '../../components/htmlMediaHelper';
|
||||||
import profileBuilder from '../../scripts/browserDeviceProfile';
|
import profileBuilder from '../../scripts/browserDeviceProfile';
|
||||||
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
||||||
import Events from '../../utils/events.ts';
|
import Events from '../../utils/events.ts';
|
||||||
import { UserSettings } from '../../scripts/settings/userSettings';
|
|
||||||
|
|
||||||
function getDefaultProfile() {
|
function getDefaultProfile() {
|
||||||
return profileBuilder({});
|
return profileBuilder({});
|
||||||
|
@ -109,10 +108,9 @@ 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()){
|
if (userSettings.enableAudioNormalization()) {
|
||||||
const dbGain = -18 - options.item.LUFS;
|
const dbGain = -18 - options.item.LUFS;
|
||||||
console.debug(options.item);
|
self.gainNode.gain.value = Math.pow(10, (dbGain / 20));
|
||||||
self.gainNode.gain.value = Math.pow(10, (dbGain/20));
|
|
||||||
} else {
|
} else {
|
||||||
self.gainNode.gain.value = 1;
|
self.gainNode.gain.value = 1;
|
||||||
}
|
}
|
||||||
|
@ -120,15 +118,12 @@ class HtmlAudioPlayer {
|
||||||
|
|
||||||
console.debug('gain:' + self.gainNode.gain.value);
|
console.debug('gain:' + self.gainNode.gain.value);
|
||||||
|
|
||||||
|
|
||||||
// Convert to seconds
|
// Convert to seconds
|
||||||
const seconds = (options.playerStartPositionTicks || 0) / 10000000;
|
const seconds = (options.playerStartPositionTicks || 0) / 10000000;
|
||||||
if (seconds) {
|
if (seconds) {
|
||||||
val += '#t=' + seconds;
|
val += '#t=' + seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
htmlMediaHelper.destroyHlsPlayer(self);
|
htmlMediaHelper.destroyHlsPlayer(self);
|
||||||
|
|
||||||
self._currentPlayOptions = options;
|
self._currentPlayOptions = options;
|
||||||
|
@ -272,7 +267,7 @@ class HtmlAudioPlayer {
|
||||||
source.connect(gainNode);
|
source.connect(gainNode);
|
||||||
gainNode.connect(audioCtx.destination);
|
gainNode.connect(audioCtx.destination);
|
||||||
|
|
||||||
self.gainNode = gainNode
|
self.gainNode = gainNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnded() {
|
function onEnded() {
|
||||||
|
|
|
@ -162,13 +162,13 @@ export class UserSettings {
|
||||||
* @return {boolean} 'Enable Audio Normalization' state.
|
* @return {boolean} 'Enable Audio Normalization' state.
|
||||||
*/
|
*/
|
||||||
enableAudioNormalization(val) {
|
enableAudioNormalization(val) {
|
||||||
if (val !== undefined) {
|
if (val !== undefined) {
|
||||||
return this.set('enableAudioNormalization', val.toString(), false);
|
return this.set('enableAudioNormalization', val.toString(), false);
|
||||||
}
|
|
||||||
|
|
||||||
return toBoolean(this.get('enableAudioNormalization', false), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return toBoolean(this.get('enableAudioNormalization', false), true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get or set 'Next Video Info Overlay' state.
|
* Get or set 'Next Video Info Overlay' state.
|
||||||
* @param {boolean|undefined} val - Flag to enable 'Next Video Info Overlay' or undefined.
|
* @param {boolean|undefined} val - Flag to enable 'Next Video Info Overlay' or undefined.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue