jellyfin / jellyfin-android

Android Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
1.57k stars 251 forks source link

Prevent destruction of session, so that an app restart can reconnect (chromecast). #1469

Open Tukajo opened 2 months ago

Tukajo commented 2 months ago

This is my first commit but I'd like to keep things small-ish/have targeted improvement.

There is an issue where the controls have repeatedly disappeared for various users: https://github.com/jellyfin/jellyfin-android/issues/459

This change set at least allows the user to forcibly close the app and re-open it, allowing for a reconnection to the session.

The downside is that the session will continue until the user intentionally stops it. Which means that it could potentially continue playing in the background indefinitely unless the server is somehow configured with an "Are you still here?" style of message & session booting based on no user input.

I still think this is better for the time being, because the alternative is that every time I lose control of the chromecast controls, I have to restart the app, which actually stops my TV from chromecasting, and I lose all my progress. This is exceedingly annoying as is.

By comparison, when YouTube is closed while chromecasting, it continues to operate (eventually displaying that "are you still here?" message).

Further notes:

  1. I do not think this should be the final state. I am having trouble trying to figure out how to get the app (on opening) to automatically reconnect to any still-alive session, and re-display the controls automatically. Today the user has to manually navigate the controls again to reconnect, and hit "remote control" again. At least it's better than the entire casting session stopping.

Changes

Issues https://github.com/jellyfin/jellyfin-android/issues/459

3flex commented 2 months ago

Would this also fix #184? Or is #184 describing this limitation:

I am having trouble trying to figure out how to get the app (on opening) to automatically reconnect to any still-alive session, and re-display the controls automatically. Today the user has to manually navigate the controls again to reconnect, and hit "remote control" again

Tukajo commented 2 months ago

Would this also fix #184? Or is #184 describing this limitation:

I am having trouble trying to figure out how to get the app (on opening) to automatically reconnect to any still-alive session, and re-display the controls automatically. Today the user has to manually navigate the controls again to reconnect, and hit "remote control" again

It will allow you to reconnect. (You can build this yourself to see).

But it's not automatic yet. I was having trouble getting the automatic reconnect to work.

However you can manually reconnect by reperforming the normal steps you would do.