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 proposed: App crash on when attempting to playback from Emby server #467

Closed
chaosloth opened this issue Jul 11, 2021 · 7 comments · Fixed by #504
Closed

Fix proposed: App crash on when attempting to playback from Emby server #467

chaosloth opened this issue Jul 11, 2021 · 7 comments · Fixed by #504
Labels
bug Something isn't working

Comments

@chaosloth
Copy link

Application hangs when playing any media from Emby server due to server responding with NoCompatibleStream . There are two bugs that need to be fixed (see below)

Steps to Reproduce

  1. Load JellyFin client on Roku box, in my case Telstra TV
  2. Connect to server
  3. Choose any media file to play
  4. Once Play button is clicked, application hangs
  5. Roku debug output shows crash with pkg:/source/VideoPlayer.brs

Resolution for crash

The issue is caused by uncaught error in AddVideoContent(), in response to a POST {server}/Items/{0}/PlaybackInfo the server returns {"MediaSources":[],"ErrorCode":"NoCompatibleStream"} The fix to stop the app crash is to add a check on the returned error code and to bail out of the function.

After VideoPlayer.brs:61
playbackInfo = ItemPostPlaybackInfo(video.id, mediaSourceId, audio_stream_idx, subtitle_idx, playbackPosition)

Add something like this

  if playbackinfo.ErrorCode = "NoCompatibleStream"
    video.content = invalid
    return
  end if

Resolution for root cause

The underlying cause to the NoCompatibleStream is due to mediasourceid being passed with an invalid value. The value being passed is the video.id, where as it should either be blank or the actual media source id. A simple fix is to simply force it to be null.

Simply replace, near line VideoPlayer.brs:59 with comment: ' Call PlayInfo from server
mediaSourceId = video.id

with
mediaSourceId = ""

-Enjoy. Conno

@chaosloth chaosloth added the bug Something isn't working label Jul 11, 2021
@jimdogx
Copy link
Contributor

jimdogx commented Nov 29, 2021

Thank you! This fixed my inability to play anything on my new TCL Roku TV (jellyfin worked just fine with a previous TV and a Roku USB stick).

@neilsb
Copy link
Member

neilsb commented Nov 29, 2021

Thank you! This fixed my inability to play anything on my new TCL Roku TV (jellyfin worked just fine with a previous TV and a Roku USB stick).

Can I just check if you were having problems playing from a Jellyfin server, or were you using an Emby server?

@crobibero
Copy link
Member

Thank you! This fixed my inability to play anything on my new TCL Roku TV (jellyfin worked just fine with a previous TV and a Roku USB stick).

Can I just check if you were having problems playing from a Jellyfin server, or were you using an Emby server?

It’s (my) Jellyfin server, currently running 10.8-alpha2

@jimdogx
Copy link
Contributor

jimdogx commented Nov 29, 2021

Can I just check if you were having problems playing from a Jellyfin server, or were you using an Emby server?

Sorry, I should have been more clear, this is connecting to a Jellyfin server. I know this issue is specific to the Emby server, but after debugging the latest master branch I found it was crashing for the same reason (NoCompatibleStream error). Also note that the latest jellyfin-roku from the Roku store was working fine with an old Roku USB stick. This only started happening when I upgraded to a TCL Roku TV.

@neilsb
Copy link
Member

neilsb commented Nov 29, 2021

OK - thanks - that's great. I see your comment on #397 too. I'll look check exactly what's happening and get that fix in place as long as it doesn't look like it will affect anything else.

@neilsb
Copy link
Member

neilsb commented Dec 3, 2021

There were 2 lines (in one place) that was setting the MediaSourceId to the video id. All other references in the app appear to be setting to the correct MediaSourceId (or empty string).

Updated the 2 lines that were setting it incorrectly to use the correct MediaSourceId.

@jimdogx
Copy link
Contributor

jimdogx commented Dec 3, 2021

FYI @neilsb, I pulled down your branch with the fix and it worked on my TCL Roku TV. 👍

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

Successfully merging a pull request may close this issue.

4 participants