Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix LiveTV Playback #6166

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/playback/playbackmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2573,8 +2573,8 @@ export class PlaybackManager {
}

const apiClient = ServerConnections.getApiClient(item.ServerId);
const mediaSourceId = playOptions.mediaSourceId || item.Id;
const getMediaStreams = apiClient.getItem(apiClient.getCurrentUserId(), mediaSourceId)
let mediaSourceId = playOptions.mediaSourceId;
const getMediaStreams = apiClient.getItem(apiClient.getCurrentUserId(), mediaSourceId || item.Id)
.then(fullItem => {
return fullItem.MediaStreams;
});
Expand Down Expand Up @@ -2611,9 +2611,11 @@ export class PlaybackManager {
autoSetNextTracks(prevSource, mediaStreams, trackOptions, user.Configuration.RememberAudioSelections, user.Configuration.RememberSubtitleSelections);
if (trackOptions.DefaultAudioStreamIndex != null) {
options.audioStreamIndex = trackOptions.DefaultAudioStreamIndex;
mediaSourceId = mediaSourceId || item.Id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird to do it here. We can probably leave mediaSourceId undefined as it was before the stream fix. I guess the server uses item Id when media source Id is not specified.

Copy link
Member Author

@viown viown Oct 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my testing, DefaultSubtitleStreamIndex and DefaultAudioStreamIndex don't always get set according to options.subtitleStreamIndex and options.audioStreamIndex unless mediaSourceId is defined.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
if (trackOptions.DefaultSubtitleStreamIndex != null) {
options.subtitleStreamIndex = trackOptions.DefaultSubtitleStreamIndex;
mediaSourceId = mediaSourceId || item.Id;
}

return getPlaybackMediaSource(player, apiClient, deviceProfile, item, mediaSourceId, options).then(async (mediaSource) => {
Expand Down
Loading