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

Fix LiveTV Playback #6166

wants to merge 2 commits into from

Conversation

viown
Copy link
Member

@viown viown commented Oct 5, 2024

Fixes LiveTV playback not working when specifying mediaSourceId

Changes

Issues
Fixes #6164

@viown viown requested a review from a team as a code owner October 5, 2024 05:52
@viown viown added regression We broke something bug Something isn't working labels Oct 5, 2024
Copy link

sonarcloud bot commented Oct 5, 2024

@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit 95e23875f4e2761a8ed65d73dd5b94977e0d0d79
Status ✅ Deployed!
Preview URL https://1b0ff70d.jellyfin-web.pages.dev
Type 🔀 Preview

@@ -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.

@viown
Copy link
Member Author

viown commented Oct 5, 2024

@dmitrylyzo Also is mediaSourceId not working with live TV a server bug? (returns NoCompatibleStream). Would it be better to fix this on the server than workaround it here?

@dmitrylyzo
Copy link
Contributor

@dmitrylyzo Also is mediaSourceId not working with live TV a server bug? (returns NoCompatibleStream). Would it be better to fix this on the server than workaround it here?

Probably. Here and here MediaSourceId is superseded by LiveStreamId. Here it is not.
I don't know why we need 2 separate parameters or even why we can't use the item id as the source for LiveTV.

Possible fix: we can make them mutually exclusive:

if (mediaSourceId) {
query.MediaSourceId = mediaSourceId;
}
if (liveStreamId) {
query.LiveStreamId = liveStreamId;
}

    if (liveStreamId) {
        query.LiveStreamId = liveStreamId;
    } else if (mediaSourceId) {
        query.MediaSourceId = mediaSourceId;
    }

There was a regression in the server that was recently fixed. Made a comment on that issue. But now I think that it fails here. I am surfing the code from mobile and could be wrong.

@viown
Copy link
Member Author

viown commented Oct 5, 2024

I should note that liveStreamId isn't set by getPlaybackMediaSource

return getPlaybackInfo(player, apiClient, item, deviceProfile, mediaSourceId, null, options).then(function (playbackInfoResult) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression We broke something
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live TV playback error
3 participants