audiobookshelf-app
audiobookshelf-app copied to clipboard
iOS book starts playing when app opens
Steps to reproduce
- Listen to book (it's one I've downloaded)
- Pause book (typically done from lock screen, not sure if it matters)
- Hours later, open the app
- The last book will resume playing before the UI is finished loading
Expected behaviour
- Preferred behavior: The book doesn't automatically start playing (or if some users want it to, make it configurable in the app settings to 'autoplay when opened'.
- At the very least, I'd prefer if the book didn't start playing before the UI was loaded... it's playing before the player is even visible... so I have to wait for several seconds for the player UI to show up in order to pause the book.
Actual behaviour
- Tell us what happens
Environment data
Audiobookshelf Version: 2.5.0
- [ ] Android App?
- [x] iOS App? - version 0.9.68-beta
iOS Issue
iOS Version: 17.1.2
iPhone model: iPhone 12 Pro
I'm not able to reproduce this. What version of the iOS app are you using?
Is this happening every time for you? Are you leaving the app open in the background or closing it?
app version 0.9.68-beta
(updated in og description)
I typically always switch apps (leaving apps in the bg)... until something doesn't seem to be working, then I'll hard-close the app and re-open it.
It's happened several times in the past week, but it doesn't seem to happen all of the time... often enough to be a little annoying :)
Just happened again...
I put in my airpods... Unlocked my phone... Opened the app...
The book started playing immediately... Here's the ui
Then I try tapping on the book... But it won't open until the ui finishes loading...
Then the book opens (it's still playing) and there's no player UI showing...
I click play button and it pauses the book and it shows the player UI at the bottom...
It’s a weird one. I get the same issue. Doesn’t really bother me but still, curious.
I experienced this same issue. Here are some additional details in case it is helpful in recreating:
I was listening to a book on my iPhone in the car via Bluetooth. I then switched the car to play a different audio source (though I don't think I explicitly paused Audiobookshelf) I then was listening on my phone to the same book via headphones. I then paused the book in my phone. I then listened to the book on my iPad via headphones. I paused the iPad. Both devices were put down for several hours, but the app was not killed on either device. When I picked up the phone several hours later, this issue popped up.
The immediately-start-playing issue doesn't bother me too much (I would hate to have a fix for this prevent being able to get in and out of a car and continue listening without a bunch of button presses), but I experienced a secondary issue where the controls were not visible while the book was playing. Possibly the same as OP's "before the UI is finished loading."
P.S. I meant to mention that major kudos are deserved fro the developers of this app. This is one of the best if not the best open source iOS apps I've experienced. It looks beautiful, runs smoothly, and does what it's supposed to. This is the one bug that I've found so far.
I also have the same issue, it used to happen before but seems to got fixed. But now it's back. Also not a big issue, i usually just press play again and it continues with the controls.
This happens whether the book is downloaded or streaming. The streaming one is way more confusing because it starts playing the audio even before the server connects.
When I go to the book that's playing it shows as if it isn't playing.
This is also happening on the macOS client which seems to be the iOS app running on Mac. It randomly starts playing there and I can't get the play controls to come up so I have to quit the app.
I just updated the server app so I'll test it this week and report back.
Still present on the latest server version and updated iOS app. It will even continue playing a file that isn't downloaded while the server is disconnected.
It will even continue playing a file that isn't downloaded while the server is disconnected.
This isn't too surprising. Presumably the app caches some duration while it's streaming. Would be interesting to know how long it will play when this happens.
I also have the same issue with the latest version...
It will even continue playing a file that isn't downloaded while the server is disconnected.
This isn't too surprising. Presumably the app caches some duration while it's streaming. Would be interesting to know how long it will play when this happens.
In a recent play, I just left the house and left my wifi, I opened my app in the car and got about 3-5 min away when it stopped and I noticed it wasn't connected to my server. I killed the app and reconnected and it played fine.
I agree that it seems that the app is automatically playing from the cache. I think I'd prefer it if it wouldn't autoplay when I open the app.
Is anyone able to reproduce this consistently yet? I'm trying to reproduce it again but unsuccessful so far.
By reproduce consistently I mean you are able to cause this to happen with a specific set of steps that you can share.
I've taken a guess at what could be happening while reading through the docs but I can't be sure until I can reproduce it. https://developer.apple.com/documentation/avfaudio/avaudiosession/interruptionreason/appwassuspended
Let me know if this issue persists in 0.9.72-beta
I'll test it asap. I made attempts to trigger this intentionally (to try to gauge a cause/effect) for about 20 min yesterday and couldn't get it to happen. Then it happened (seemingly randomly) when I opened the app last night.... and then again just now when I opened up the app to check what version I had installed (0.9.71). I'll update again next week if I do or don't see it again (after updating).
So this is continuing to happen to me in the latest version (0.9.72). Idk if this is related, but I also experienced my current book starting to play at 1-2 AM seemingly on it's own.
This is really weird. I wonder if there's some logging that could be enabled (perhaps that I could opt-into) that could cache interactions that I could then send you (or upload here) to help triage this issue.
If we're right that this is a caching issue, the server may not even know. Thus, logs may not be entirely useful.
Still happened with the latest build, even with downloaded local files.
The best way to figure this out is to find out how to reproduce it
I experienced an extreme example of this last night where a book started playing randomly at midnight. The phone was otherwise sitting peacefully on my nightstand. When I opened the app to stop it, I was greeted with this:
There was at least one, if not 2 more copies of the error message on the screen when I first opened it, and they were disappearing quickly. I didn't have my full senses about me, but I don't believe I had the option to stop the playback from within the app and had to force quit the app to get playback to stop (i.e., the playback controls were missing).
Steps to repeat:
- Open app from force-closed state
- Play book for about 2-5 minutes
- Pause book (I think i used the in-app controls for this, but it's possible I used the lock screen widget)
- Switch to a different app, but leave player open in background
- About 8 hours later, playback randomly restarted
I had not touched the app since pausing.
I experienced an extreme example of this last night where a book started playing randomly at midnight. The phone was otherwise sitting peacefully on my nightstand. When I opened the app to stop it, I was greeted with this:
There was at least one, if not 2 more copies of the error message on the screen when I first opened it, and they were disappearing quickly. I didn't have my full senses about me, but I don't believe I had the option to stop the playback from within the app and had to force quit the app to get playback to stop (i.e., the playback controls were missing).
Steps to repeat:
- Open app from force-closed state.
- Play book for about 2-5 minutes
- Pause book (I think i used the in-app controls for this, but it's possible I used the lock screen widget)
- About 8 hours later, playback randomly restarted
I had not touched the app since pausing.
It also started playing at night here as well randomly. It had been a few hours since I last used it.
I know it was mentioned that this also happens while streaming but the screenshots I've seen so far have all been downloaded. Is it possible the streaming is a slightly different situation happening that is getting conflated with this one? Because that happens often and makes it difficult to narrow down the issue.
This book was not downloaded -- at least not manually.
I'm currently on book 16 of Dresden Files... I've been streaming this series since book 10 and still seeing this issue... so I don't think it's specific to downloaded vs streaming.
I'm surprised you haven't been able to reproduce this. I just tried it again (play, pause, don't force close, wait many hours, open app) and it did it again. I have a habit of force closing apps, so I think I'm 3 for 3 when leaving it in the background and having it play when re-opening.
I have this issue too on latest ios 17.3.1 and latest ABS ios app version 0.9.72 beta
It seems like after the ABS app is in the background for a while, it forgets its playback state even though it's for sure paused. When opening the app it resumes to become playing BUT WITHOUT the miniplayer coming up
I have this issue too on latest ios and latest ABS ios app version
Would you mind adding the version numbers instead of just latest
, since that can help with future debugging when reviewing old issues? Assuming that's 0.9.72
I have this issue too on latest ios and latest ABS ios app version
Would you mind adding the version numbers instead of just
latest
, since that can help with future debugging when reviewing old issues? Assuming that's 0.9.72
done, thank you. any logs i can provide to help?
Here is a video of the exact bug that I’m experiencing.
I was playing an audiobook a few hours ago. The ABS app v0.9.72 stays in background apps for iOS 17.3.1, then when I open up the app the play continues to resume. Note that the mini player at the bottom does NOT show up at the bottom. It does if I manually hit play, but not when encountering this bug
https://github.com/advplyr/audiobookshelf-app/assets/53108354/d158c905-84df-4775-9860-82a7f8c83927
These are my logs:
Server Log Level
2024-02-27 03:45:29.246
INFO
[SocketAuthority] Socket Connected N9VHAZFqL21fdDG4AABb
2024-02-27 03:45:29.716
INFO
[PlaybackSessionManager] Syncing local session "Real Tigers" (1e47c6cb-8558-46e4-a72e-d37947abc8f0)
2024-02-27 03:45:35.872
INFO
[PlaybackSessionManager] startSession: Closing open session "Real Tigers" for user "adminABS" (Device: iPhone16,2 / v0.9.72)
2024-02-27 03:46:10.010
INFO
[SocketAuthority] Socket N9VHAZFqL21fdDG4AABb disconnected from client "adminABS" after 40764ms (Reason: transport close)
That’s effectively identical to what I experience. I’m using an iPhone 13 mini in case that’s making a difference.
yes, that's the exact same UX I have as well