mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix stream selection remembering
This commit is contained in:
parent
c8590d37ed
commit
2b0091eca2
5 changed files with 37 additions and 26 deletions
|
@ -2300,7 +2300,7 @@ class PlaybackManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoSetNextTracks(prevSource, mediaSource) {
|
function autoSetNextTracks(prevSource, mediaSource, audio, subtitle) {
|
||||||
try {
|
try {
|
||||||
if (!prevSource) return;
|
if (!prevSource) return;
|
||||||
|
|
||||||
|
@ -2319,8 +2319,11 @@ class PlaybackManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
rankStreamType(prevSource.DefaultAudioStreamIndex, prevSource, mediaSource, 'Audio');
|
if (audio)
|
||||||
rankStreamType(prevSource.DefaultSubtitleStreamIndex, prevSource, mediaSource, 'Subtitle');
|
rankStreamType(prevSource.DefaultAudioStreamIndex, prevSource, mediaSource, 'Audio');
|
||||||
|
|
||||||
|
if (subtitle)
|
||||||
|
rankStreamType(prevSource.DefaultSubtitleStreamIndex, prevSource, mediaSource, 'Subtitle');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`AutoSet - Caught unexpected error: ${e}`);
|
console.error(`AutoSet - Caught unexpected error: ${e}`);
|
||||||
}
|
}
|
||||||
|
@ -2385,8 +2388,18 @@ class PlaybackManager {
|
||||||
playOptions.items = null;
|
playOptions.items = null;
|
||||||
|
|
||||||
return getPlaybackMediaSource(player, apiClient, deviceProfile, maxBitrate, item, startPosition, mediaSourceId, audioStreamIndex, subtitleStreamIndex).then(function (mediaSource) {
|
return getPlaybackMediaSource(player, apiClient, deviceProfile, maxBitrate, item, startPosition, mediaSourceId, audioStreamIndex, subtitleStreamIndex).then(function (mediaSource) {
|
||||||
if (userSettings.enableSetUsingLastTracks())
|
const user = apiClient.getCurrentUser();
|
||||||
autoSetNextTracks(prevSource, mediaSource);
|
if (user.Configuration.RememberAudioSelections) {
|
||||||
|
if (user.Configuration.RememberSubtitleSelections)
|
||||||
|
autoSetNextTracks(prevSource, mediaSource, true, true);
|
||||||
|
else
|
||||||
|
autoSetNextTracks(prevSource, mediaSource, true, false);
|
||||||
|
} else {
|
||||||
|
if (user.Configuration.RememberSubtitleSelections)
|
||||||
|
autoSetNextTracks(prevSource, mediaSource, false, true);
|
||||||
|
else
|
||||||
|
autoSetNextTracks(prevSource, mediaSource, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
const streamInfo = createStreamInfo(apiClient, item.MediaType, item, mediaSource, startPosition, player);
|
const streamInfo = createStreamInfo(apiClient, item.MediaType, item, mediaSource, startPosition, player);
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,8 @@ import template from './playbackSettings.template.html';
|
||||||
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('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay();
|
context.querySelector('.chkEnableNextVideoOverlay').checked = userSettings.enableNextVideoInfoOverlay();
|
||||||
context.querySelector('.chkSetUsingLastTracks').checked = userSettings.enableSetUsingLastTracks();
|
context.querySelector('.chkRememberAudioSelections').checked = user.Configuration.RememberAudioSelections || false;
|
||||||
|
context.querySelector('.chkRememberSubtitleSelections').checked = user.Configuration.RememberSubtitleSelections || false;
|
||||||
context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers();
|
context.querySelector('.chkExternalVideoPlayer').checked = appSettings.enableSystemExternalPlayers();
|
||||||
|
|
||||||
setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
|
setMaxBitrateIntoField(context.querySelector('.selectVideoInNetworkQuality'), true, 'Video');
|
||||||
|
@ -222,7 +223,8 @@ import template from './playbackSettings.template.html';
|
||||||
userSettingsInstance.enableCinemaMode(context.querySelector('.chkEnableCinemaMode').checked);
|
userSettingsInstance.enableCinemaMode(context.querySelector('.chkEnableCinemaMode').checked);
|
||||||
|
|
||||||
userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector('.chkEnableNextVideoOverlay').checked);
|
userSettingsInstance.enableNextVideoInfoOverlay(context.querySelector('.chkEnableNextVideoOverlay').checked);
|
||||||
userSettingsInstance.enableSetUsingLastTracks(context.querySelector('.chkSetUsingLastTracks').checked);
|
user.Configuration.RememberAudioSelections = context.querySelector('.chkRememberAudioSelections').checked;
|
||||||
|
user.Configuration.RememberSubtitleSelections = context.querySelector('.chkRememberSubtitleSelections').checked;
|
||||||
userSettingsInstance.chromecastVersion(context.querySelector('.selectChromecastVersion').value);
|
userSettingsInstance.chromecastVersion(context.querySelector('.selectChromecastVersion').value);
|
||||||
userSettingsInstance.skipForwardLength(context.querySelector('.selectSkipForwardLength').value);
|
userSettingsInstance.skipForwardLength(context.querySelector('.selectSkipForwardLength').value);
|
||||||
userSettingsInstance.skipBackLength(context.querySelector('.selectSkipBackLength').value);
|
userSettingsInstance.skipBackLength(context.querySelector('.selectSkipBackLength').value);
|
||||||
|
|
|
@ -84,10 +84,18 @@
|
||||||
|
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription">
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" is="emby-checkbox" class="chkSetUsingLastTracks" />
|
<input type="checkbox" is="emby-checkbox" class="chkRememberAudioSelections" />
|
||||||
<span>${SetUsingLastTracks}</span>
|
<span>${RememberAudioSelections}</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="fieldDescription checkboxFieldDescription">${SetUsingLastTracksHelp}</div>
|
<div class="fieldDescription checkboxFieldDescription">${RememberAudioSelectionsHelp}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="checkboxContainer checkboxContainer-withDescription">
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" is="emby-checkbox" class="chkRememberSubtitleSelections" />
|
||||||
|
<span>${RememberSubtitleSelections}</span>
|
||||||
|
</label>
|
||||||
|
<div class="fieldDescription checkboxFieldDescription">${RememberSubtitleSelectionsHelp}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="checkboxContainer checkboxContainer-withDescription fldEnableNextVideoOverlay">
|
<div class="checkboxContainer checkboxContainer-withDescription fldEnableNextVideoOverlay">
|
||||||
|
|
|
@ -166,19 +166,6 @@ export class UserSettings {
|
||||||
return val !== 'false';
|
return val !== 'false';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get or set 'SetUsingLastTracks' state.
|
|
||||||
* @param {boolean|undefined} val - Flag to enable 'SetUsingLastTracks' or undefined.
|
|
||||||
* @return {boolean} 'SetUsingLastTracks' state.
|
|
||||||
*/
|
|
||||||
enableSetUsingLastTracks(val) {
|
|
||||||
if (val !== undefined) {
|
|
||||||
return this.set('enableSetUsingLastTracks', val.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.get('enableSetUsingLastTracks', false) !== 'false';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get or set 'Theme Songs' state.
|
* Get or set 'Theme Songs' state.
|
||||||
* @param {boolean|undefined} val - Flag to enable 'Theme Songs' or undefined.
|
* @param {boolean|undefined} val - Flag to enable 'Theme Songs' or undefined.
|
||||||
|
@ -570,7 +557,6 @@ export const allowedAudioChannels = currentSettings.allowedAudioChannels.bind(cu
|
||||||
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 enableNextVideoInfoOverlay = currentSettings.enableNextVideoInfoOverlay.bind(currentSettings);
|
export const enableNextVideoInfoOverlay = currentSettings.enableNextVideoInfoOverlay.bind(currentSettings);
|
||||||
export const enableSetUsingLastTracks = currentSettings.enableSetUsingLastTracks.bind(currentSettings);
|
|
||||||
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);
|
export const enableThemeSongs = currentSettings.enableThemeSongs.bind(currentSettings);
|
||||||
export const enableThemeVideos = currentSettings.enableThemeVideos.bind(currentSettings);
|
export const enableThemeVideos = currentSettings.enableThemeVideos.bind(currentSettings);
|
||||||
export const enableFastFadein = currentSettings.enableFastFadein.bind(currentSettings);
|
export const enableFastFadein = currentSettings.enableFastFadein.bind(currentSettings);
|
||||||
|
|
|
@ -1353,7 +1353,11 @@
|
||||||
"RefreshQueued": "Refresh queued.",
|
"RefreshQueued": "Refresh queued.",
|
||||||
"ReleaseDate": "Release date",
|
"ReleaseDate": "Release date",
|
||||||
"ReleaseGroup": "Release Group",
|
"ReleaseGroup": "Release Group",
|
||||||
|
"RememberAudioSelections": "Set audio track based on previous item",
|
||||||
|
"RememberAudioSelectionsHelp": "Try to set the audio track to the closest match to the last video.",
|
||||||
"RememberMe": "Remember Me",
|
"RememberMe": "Remember Me",
|
||||||
|
"RememberSubtitleSelections": "Set subtitle track based on previous item",
|
||||||
|
"RememberSubtitleSelectionsHelp": "Try to set the subtitle track to the closest match to the last video.",
|
||||||
"Remixer": "Remixer",
|
"Remixer": "Remixer",
|
||||||
"RemoveFromCollection": "Remove from collection",
|
"RemoveFromCollection": "Remove from collection",
|
||||||
"RemoveFromPlaylist": "Remove from playlist",
|
"RemoveFromPlaylist": "Remove from playlist",
|
||||||
|
@ -1401,8 +1405,6 @@
|
||||||
"Settings": "Settings",
|
"Settings": "Settings",
|
||||||
"SettingsSaved": "Settings saved.",
|
"SettingsSaved": "Settings saved.",
|
||||||
"SettingsWarning": "Changing these values may cause instability or connectivity failures. If you experience any problems, we recommend changing them back to default.",
|
"SettingsWarning": "Changing these values may cause instability or connectivity failures. If you experience any problems, we recommend changing them back to default.",
|
||||||
"SetUsingLastTracks": "Set Subtitle/Audio Tracks with Previous Item",
|
|
||||||
"SetUsingLastTracksHelp": "Try to set the Subtitle/Audio track to the closest match to the last video.",
|
|
||||||
"Share": "Share",
|
"Share": "Share",
|
||||||
"ShowAdvancedSettings": "Show advanced settings",
|
"ShowAdvancedSettings": "Show advanced settings",
|
||||||
"ShowIndicatorsFor": "Show indicators for:",
|
"ShowIndicatorsFor": "Show indicators for:",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue