LeoKlaus / plappa

An Audiobook client for Jellyfin and AudioBookShelf, written in Swift/SwiftUI.
https://plappa.me
159 stars 0 forks source link

[BUG] Briefly wouldn’t play from lock screen #95

Open SecrestTheHuman opened 1 month ago

SecrestTheHuman commented 1 month ago

Describe the bug The app started not being able to play whenever I locked my screen. I would play it then lock my screen and it fade out and stop playing. I did this several times. This issue was resolved in the moment by closing and reopening the app. On my lock screen I could see the audiobook widget, but it was unresponsive.

To Reproduce Steps to reproduce the behavior: Unfortunately, I have no idea how to replicate this as I have no idea how it happened or why.

I’m just bringing it to your attention in case it’s somehow a symptom of a larger problem I’m not seeing. It doesn’t seem to be persistent, but if it happens again I’ll try to make more of a mental note of what I did before it happened.

Expected behavior I should be able to play the audiobook from my lock screen.

Environment(please complete the following information):

Additional context I downloaded the file to my phone from my server earlier today. I am aware I’m slighly out of date on my version of ABS, so I will be updating that today. I do believe I hadn’t closed the app since downloading it. I had paused and stopped it a few times throughout, sometimes for extended periods of time.

I didn’t think to look at the logs before closing the app and they seem to have reset after I did.

LeoKlaus commented 1 month ago

Thank you for reporting this! Not trying to point any fingers here, but could this have been a bug in iOS? The playback widget is part of the OS, plappa can just instruct it what to do with the controls.

The commands for the playback widget are set whenever a book/podcast episode is started, so it could theoretically fail. In that case, the book shouldn't start playing though and that also wouldn't explain why playback stopped when you locked the phone.

SecrestTheHuman commented 1 month ago

Definitely could be an iOS issue. Wouldn’t surprise me at all. It did happen again. I grabbed the log this time.

[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates
[5/5/2024, 23:05] [AudioBookShelfAPIHandler] Successfully pushed playbackstates

I actually do have a bit more information. The counter goes up when I try to play it from the lock screen, it’s just that no sound plays. Also the button changes to a pause button, but I can’t “pause” it. It just keeps counting up until I play it again in Plappa. When I jump forwards or backwards the time jumps according to the button and the counter stops progressing. No time progresses in my book while all this is happening.

Closing and reopening the app still fixes it. No idea what caused it. Before it happened I just paused, left the room, and came back. Nothing out of the ordinary I can thing of.

SecrestTheHuman commented 1 month ago

Oh, fwiw I also have not updated ABS yet. Meant to do that, but forgot. Will do that now.

LeoKlaus commented 1 month ago

The logs look fine, thank you for sending them. They also show that plappa hasn't crashed in the background which was my concern.

The counter goes up when I try to play it from the lock screen, it’s just that no sound plays. Also the button changes to a pause button, but I can’t “pause” it. It just keeps counting up until I play it again in Plappa. When I jump forwards or backwards the time jumps according to the button and the counter stops progressing. No time progresses in my book while all this is happening.

That's the default behavior of the now playing widget, almost seems like the "connection" to plappa stopped working. Have you found a way to reliably reproduce this or does it just seem to happen randomly?

LeoKlaus commented 1 month ago

Does switching to another audiobook fix the issue as well? plappa will reset the now playing widget whenever a new book is loaded.

SecrestTheHuman commented 1 month ago

I have not found a way to reproduce it unfortunately. Seems completely random. If it happens again l’ll try switching to another audiobook to see what happens.