chore: implement feedback

This commit is contained in:
Ivan Schurawel 2023-02-17 17:45:43 -05:00 committed by Ivan Schurawel
parent c74c0cddde
commit 89ec4cf9cf
2 changed files with 15 additions and 19 deletions

View file

@ -1724,7 +1724,7 @@ class PlaybackManager {
}).then(function (deviceProfile) {
const audioStreamIndex = params.AudioStreamIndex == null ? getPlayerData(player).audioStreamIndex : params.AudioStreamIndex;
const subtitleStreamIndex = params.SubtitleStreamIndex == null ? getPlayerData(player).subtitleStreamIndex : params.SubtitleStreamIndex;
const secondarySubtitleStreamIndex = params.SubtitleStreamIndex == null ? getPlayerData(player).secondarySubtitleStreamIndex : params.secondarySubtitleStreamIndex;
const secondarySubtitleStreamIndex = params.SecondarySubtitleStreamIndex == null ? getPlayerData(player).secondarySubtitleStreamIndex : params.SecondarySubtitleStreamIndex;
let currentMediaSource = self.currentMediaSource(player);
const apiClient = ServerConnections.getApiClient(currentItem.ServerId);
@ -2399,7 +2399,7 @@ class PlaybackManager {
}
}
function autoSetNextTracks(prevSource, mediaSource, audio, subtitle, secondarySubtitle) {
function autoSetNextTracks(prevSource, mediaSource, audio, subtitle) {
try {
if (!prevSource) return;
@ -2416,7 +2416,7 @@ class PlaybackManager {
rankStreamType(prevSource.DefaultSubtitleStreamIndex, prevSource, mediaSource, 'Subtitle');
}
if (secondarySubtitle && typeof prevSource.DefaultSecondarySubtitleStreamIndex == 'number') {
if (subtitle && typeof prevSource.DefaultSecondarySubtitleStreamIndex == 'number') {
rankStreamType(prevSource.DefaultSecondarySubtitleStreamIndex, prevSource, mediaSource, 'Subtitle', true);
}
} catch (e) {
@ -2484,14 +2484,14 @@ class PlaybackManager {
return getPlaybackMediaSource(player, apiClient, deviceProfile, maxBitrate, item, startPosition, mediaSourceId, audioStreamIndex, subtitleStreamIndex).then(async (mediaSource) => {
const user = await apiClient.getCurrentUser();
const playerData = getPlayerData(player);
autoSetNextTracks(prevSource, mediaSource, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections, playerData.secondarySubtitleStreamIndex);
autoSetNextTracks(prevSource, mediaSource, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections);
const streamInfo = createStreamInfo(apiClient, item.MediaType, item, mediaSource, startPosition, player);
streamInfo.fullscreen = playOptions.fullscreen;
const playerData = getPlayerData(player);
playerData.isChangingStream = false;
playerData.maxStreamingBitrate = maxBitrate;
playerData.streamInfo = streamInfo;

View file

@ -491,20 +491,16 @@ function tryRemoveElement(elem) {
this._currentPlayOptions = options;
// Get the secondary track that has been set during this watch session
let currentSecondaryTrackIndex = playbackManager.getSecondarySubtitleStreamIndex(this);
if (!secondaryTrackValid) {
currentSecondaryTrackIndex = -1;
playbackManager.setSecondarySubtitleStreamIndex(currentSecondaryTrackIndex, this);
}
this.#secondarySubtitleTrackIndexToSetOnPlaying = currentSecondaryTrackIndex == null ? -1 : currentSecondaryTrackIndex;
if (this.#secondarySubtitleTrackIndexToSetOnPlaying != null && this.#secondarySubtitleTrackIndexToSetOnPlaying >= 0) {
const initialSecondarySubtitleStream = options.mediaSource.MediaStreams[this.#secondarySubtitleTrackIndexToSetOnPlaying];
if (!initialSecondarySubtitleStream || initialSecondarySubtitleStream.DeliveryMethod !== 'External') {
this.#secondarySubtitleTrackIndexToSetOnPlaying = -1;
if (secondaryTrackValid) {
this.#secondarySubtitleTrackIndexToSetOnPlaying = options.mediaSource.DefaultSecondarySubtitleStreamIndex == null ? -1 : options.mediaSource.DefaultSecondarySubtitleStreamIndex;
if (this.#secondarySubtitleTrackIndexToSetOnPlaying != null && this.#secondarySubtitleTrackIndexToSetOnPlaying >= 0) {
const initialSecondarySubtitleStream = options.mediaSource.MediaStreams[this.#secondarySubtitleTrackIndexToSetOnPlaying];
if (!initialSecondarySubtitleStream || initialSecondarySubtitleStream.DeliveryMethod !== 'External') {
this.#secondarySubtitleTrackIndexToSetOnPlaying = -1;
}
}
} else {
this.#secondarySubtitleTrackIndexToSetOnPlaying = -1;
}
const crossOrigin = getCrossOriginValue(options.mediaSource);