jellyfin / jellyfin-android

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

Allow media playback when app loses focus #1218

Open Darin755 opened 10 months ago

Darin755 commented 10 months ago

Describe the feature you'd like

Currently when you open another app or go to your devices home screen the media stops playing. I can see how this could be useful to someone but for me its kind of annoying. I watch live TV and during the commercials I like to check emails but when I go to open my email app the playback halts. What would be nice is if playback continued so that I can multitask without interrupting playback.

Additional context

I know some may not want this behavior so it might be good to have a setting for it. Also the simplest way to implement this might be to use the Android Media controls so that playback can be controlled from the notifications menu.

baflo commented 9 months ago

@Darin755 Do you know if this ever worked? I am new to Jellyfin and researching on this issue. It seem there are open issues on this topic sinc 2019.

EDIT: I found #109, which suggested there are different options for the player to be used. I changed Jellyfin Settings -> Client Settings -> "Video player type" -> Integrated

Seems to work now.

Strit commented 9 months ago

I don't have this issue.

Be sure that your Jellyfin app is allowed to run in the background and is not part of the battery optimizations in Android.

baflo commented 9 months ago

Sadly, it doesn't work (any more?) :(

There seem to be only "video" options, but I only have this issue with audio tracks.

Strit commented 9 months ago

I have a setting called "Allow background activity" under Android Settings -> Battery -> More Settings -> App Battery Management (my UI is not english, so it might be called something different) -> Jellyfin.

Darin755 commented 9 months ago

@Darin755 Do you know if this ever worked? I am new to Jellyfin and researching on this issue. It seem there are open issues on this topic sinc 2019.

EDIT: I found #109, which suggested there are different options for the player to be used. I changed Jellyfin Settings -> Client Settings -> "Video player type" -> Integrated

Seems to work now.

Thanks! This worked on lineage os

SpaceGameDev568 commented 6 months ago

I'm having this same issue with my music stopping when the app is not focused. Sometimes if I go back to the app it starts playing where it left off automatically, but other times it won't let me unpause the track and I have to close the app and reopen it. I attempted all of the above mentioned fixes and none of them worked for me. I'm using FinAmp for the time being until this issue gets fixed.

chielmi commented 6 months ago

Same problem here. I tried all the suggestions above, but none help. When the app is not in focus, playback wil stop after ~10 seconds... Server version 10.8.13. Edit: only using Jellyfin in a browser (Firefox in my case) seems to improve background playback.

Darin755 commented 6 months ago

For anyone having this issue, try the integrated player

chielmi commented 6 months ago

Switching to the integrated player still only works for me if the app remains in focus. If the app remains in focus it will continue to play if the screen is off. Background playback (or example when I open a browser) stops after ~10 seconds.

pilot51 commented 4 months ago

I'm having the same issue with music, which is what I mostly use Jellyfin for on my phone. v2.6.1 on Android 14 with background usage allowed.

slickdakine commented 1 month ago

I figured it out. Go to Settings/Apps/Jellyfin/App battery Usage. Make sure "allow background" is turned on. Then, tap "Allow background usage" and you'll get a new/hidden menu. It will say "optimized" and "unrestricted". Make sure you pick "unrestricted". That solved it for me.

chielmi commented 1 month ago

@slickdakine I think you're right! I've never been aware of this submenu... I changed the setting and now jellyfin indeed continues to play in the background! Thank you!

slickdakine commented 1 month ago

Your welcome. I've been troubleshooting it on and off the past couple months since I had the issue. Nothing worked. Then last night I found that menu by accident. LOL!