-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Background Audio Playback #19
Comments
Since we're SO CLOSE to getting a near-perfect Jellyfin audio experience I went ahead and saw what I could do with this. I'm familiar with programming but haven't touched any form of JavaScript since an HTML class. |
If I'm not mistaken, the Web UI in this is literally the interface from the server. That is to say, it is more like a special browser itself. Could be wrong. Paging @thornbill. |
Hey guys on Ipad 5th Gen running iOS 12.4.1 I don't have this issue closing the screen, changing apps the music will continue to play. But the next song in the play list will not start. Hope it help. |
I believe this is caused by the js execution in the webview being stopped when in the background. I saw the same behavior in iOS 12 where it would complete the current song, but not continue to the next song. It seems that iOS 13 is much more aggressive with killing background tasks and so it does not even complete playing the current song. I think the best solution is to use the NativeShell interface in web to inject a plugin to play audio via a native element. Hopefully that will resolve this issue. 🤞 |
It’s a known issue with expo: expo/expo#5472 When an expo app starts playing audio, then moves to the background, the audio will continue till the end. However, the next audio file won’t start playing (on iOS). I think react native supports background audio playback, but that would require ejecting the entire project. Looks like expo is working on a fix, no ETA: https://expo.canny.io/feature-requests/p/audio-playback-in-background |
Is the current iPhone app available in the app store outside of expo still considered the expo app? Is that why background playback isn't supported in that version either? |
@dannymichel yes it’s the same app. |
Expo issue linked above doesn’t look like it will ever be fixed. Is there an alternative? |
@TwentyH Yes? Kind of. We could eject from Expo and see about starting to re-implement this app as a “closer” to react-native project, but then that means that to work and build the iOS version, you’d have to use a Mac for development (right now that’s not required). There’s a variety of options we’re weighing internally. |
Maybe I am not operating it properly, but the iOS app is unusable as it is today, anyway, pausing every time the screen locks. Wouldn’t making it a native app work around this problem, even if it is used only for streaming (UPnP or DLNA), and keep the current web view for managing the playlist? |
@TwentyH It works in limited use cases. People were clamouring for an app for iOS, but we don't have any Swift or Objective-C developers on the team. This is the best compromise we could come up with in this time. There are other options that we are continuing to discuss internally, because we do want this experience to improve. |
@anthonylavado I am an iOS developer and would be interested in developing the native app as a regular user of Jellyfin. In case we could talk about it. |
@kruzader we can definitely talk about it 😄 since we have no extremely active iOS developers you can literally do whatever you want and if it's better than the current solution we can release it officially and start maintaining it. There is an old Swift API client in the organization you can start with if that helps at all, but it might need a few changes to get working on the latest releases. |
I found the client here and it looks like we never made any changes, but it should be 99% functional with the current server. I will say that based on our work with other API clients you will probably want to make a lot of changes. |
Was checking in on this since being able to use the jellyfin app as my primary music player is very important to me. Thought I’d also share what my current temporary solution is while I wait for background play. After hours of scouring the App Store and google for apps that could possibly interface with my Jellyfin server for specifically music I ended up finding foobar2000. It’s not my favorite music player I have used but it interfaces really well with UPnP and allows me to download every music album on my jellyfin server at once with album art and uses your music’s metadata to sort songs (you legit wouldn’t believe how hard it was to find an app that did all that in one package) It’s really not an ideal solution because foobar2000’s playlists are based on file locations and therefor updating your media in anyway requires songs maintain the same file name and location on your device. I would REALLY like to use the jellyfin app as my primary music player and will be ditching foobar2000 the moment jellyfin is capable of being my primary music player. Just thought I’d share my temp solution for anyone in need of a more immediate solution. Keep up the great work guys. |
thanks @drazil100 this works great for me until background playback is fixed |
Possibly a fix in #82, which would require testing. |
@anthonylavado |
@HarryPaulo Thank you for testing. The Android side of this app is... less tested (I'll leave that more to @thornbill). We do have an official Android app, as well as a few other Android things in development for music playback. |
I still need to test that change. I believe it only keeps the screen from automatically locking when the app is in the foreground. It’s not a real fix for playing while in the background, but it seems like a good first step. I don’t think we will get full background playback support until we implement a native player in the app. |
I agree its a good first step and I have often wondered about requesting this as a temporary measure. But really I just need background playback so I just didn't suggest it. Not having my phone fall asleep on me when I am listening to music would actually make this app usable for music at all though. At best right now I can only listen to 2 and a half minutes of music without interacting with my phone before it locks and stops background playback. |
I have a simple radio application, I am looking for a fix for my problem with the background application. maybe this can help other people, I will test this alternative, in my case it can solve, but I will stop using the expo-av: |
Relevant upstream issue: https://bugs.webkit.org/show_bug.cgi?id=203293 |
There is something of a workaround for iOS 13.5. Once playback stops, you can resume playback by pressing the play button twice on the lock screen. It seems to continue playing without stopping while in the background after that. The UI does not update correctly to reflect the current state however. |
Hi, I noticed that we can only update expo-av. The only drawback is that no
longer supports iOS 10.
…On Sat, 3 Jul 2021 at 1:09 pm, Bill Thornton ***@***.***> wrote:
Nice! It is a bit of a process to update Expo. There are normally some
migrations that need to be done for their releases. We are a few versions
behind at this point so we will need to incrementally update to 40, then
41, and finally 42 following the recommendations in their release notes
listed here <#219>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHFQJVPP3FIVXRRZEBIZL3TVZ5QJANCNFSM4JP3PKPQ>
.
|
Well it seems like this is once again an issue in iOS 15. I recommend using an alternative such as Finamp in the meantime. |
Finamp is great! If you use Jellyfin for music you should probably just use Finamp period. |
I still suffer from the same problem :( |
@drazil100
Edit: Never mind no external playback controls show for videos ( and of course audio) on the lock/notification screen |
Just adding to this thread to say this still occurs on my iOS device , and it’s made more annoying as I use Jellyfin mainly at the gym and have to switch between apps. Would really love to see this fixed somehow so I can have uninterrupted music.. FYI - when I start the Jellyfin app up the first time it seems to work fine and is ok running in the background , but if for any reason you interact with it again and bounce between apps it risks losing that ability and will get stopped by the simplest of things e.g a pop up notification . |
iPad Air with iPadOS v17.1.2, newest Jellyfin-mobile from Apple Store installed, newest released jellyfin server... but the player still stops on screen lock or when it goes in background. Any idea when this will be solved ? |
i am here to say that this is still an issue 4 years later, i'm on ios and this is one of the most annoying things, along with the fact that the next track never plays unless i'm looking at the app directly while driving. |
Do you use an alternate app on iOS ? It is a very disturbing error, but I think you are right, there are no developers interested in fixing it. I have been looking at swiftfin, which works quite nicely for video....I am looking at extending it to support audio as well, together with jukebox functionality (I have a RPI4, and I am tired of running airplay, when it could connect directly to Jellyfin). |
For me it was working till the second last iOS update (currently 17.3.1), so it was working with 17.2 or something. Some two years ago I had the same problem, but then it was fixed till now when it does not work again. |
For a music-centric use case, please check out AmpFin, a native implementation of the Jellyfin music player on iOS. The problem with this Expo implementation is not trivial to resolve because simply offloading the audio playback to the system will not be sufficient. The playback queue also needs to be offloaded, and we cannot reliably use JavaScript in the WebView to manage the music playback queue because the execution of the JS inside a webview may be paused by the OS at any time in the background. A more native implementation is required to have a reliable background playback functionality. |
I have been using finamp ever since it came out and I have been liking it. Finamp seems to have a good amount of support behind it too. I might give AmpFin a try and see how I like it but I am very happy with Finamp. |
As of iOS 17.5.1 the issue has not fixed with native Jellyfin app, thanks for recommending this app, works great and gives a premium apple music like UI vibe. |
Is there any recommendations/workaround to listen audiobooks? |
So just to confirm, on IOS the only current way (workaround) for someone to preserve their music continues to play in the background if you need to bounce between apps etc. is to use a separate Jellyfin compatible music player? Recommended players are things like finamp, or ampfin etc. This will be the approach until such a point that the Jellyfin app itself is updated to support it |
@nodecentral This is correct. But honestly I enjoy finamp so much that even IF the Jellyfin iOS app started supporting background playback I wouldn't switch back. At this point it's less of a workaround and is more just a better experience than Jellyfin app could ever be for music playback. That's not me disrespecting the official Jellyfin app either. 3rd party devs have just had enough time at this point to focus on developing music player specific features that would be extremely difficult if not impossible for the official app to support, or features that would make no sense outside of the context of music. For example one of the features in the finamp beta is that it will remember your play queue and let you resume whatever album, shuffled playlist, or whatever else you were listening to last even if you fully close and reopen the app. |
According to some pages in Expo's documentation, this isn't supported, yet on other pages, it says it is?
Here in limitations it says no:
https://docs.expo.io/versions/latest/introduction/why-not-expo/#limitations-of-the-managed-workflow
But here it says we can do it with the right app.json entry and object:
https://docs.expo.io/versions/latest/sdk/audio/#audiosetaudiomodeasyncmode
We should see what we can do to get this working.
The text was updated successfully, but these errors were encountered: