Open baron opened 3 years ago
Hi @baron ! thanks for the detailed investigation and the reproduction steps
Regarding the updateAutolock()
function
The first line checks whether the user has configured the setting and is set to true
, otherwise it doesn't continue with the rest.
I'll add this to be reviewed in the next sprint next week as well
-- EDIT
Nevermind my comment about the function, I reread your description, I'll check it out next week 👍
Thank you for giving this your attention, I wish I could be more helpful with actual code but hopefully provided you with enough information to investigate.
I have tipped before but will gladly tip again if this is resolved as I really like the app. I listened to the entire Dark Tower series by Stephen King with this app so it has a special place in my heart. Thank you for giving us such a quality app that is up to date with modern aesthetics and conventions.
@baron I tried reproducing it but with no success. Can you specify in the steps in which screen you're currently at for each one?
Regarding this line UIApplication.shared.isIdleTimerDisabled = UIDevice.current.batteryState != .unplugged
the app will only reach that if the user has enabled the Disable Autolock
feature, the first guard
statement takes care of that. For the version that is waiting for review, I have also included a UIApplication.shared.isIdleTimerDisabled = false
before the return of the first guard
, it may help in some cases(?)
@GianniCarlo I'll lookout for the update and report back. Thank you for looking into this. I'll do my best to break it down. Also, I didn't emphasize that I have "tilt to awake enabled" but this didn't affect my testing.
Steps to reproduce the behavior, provide an example of the command line issued:
Also my apologies if my title doesn't make it clear that I'm talking about the lock screen showing book cover and playback controls.
I can also make the screen sleep manually by pressing the power button. But BookPlayer is the only major audio app that shows this behavior.
I encountered the same problem
I have the same problem.
I am having the same issue, same reproduction steps.
I am having the same problem
I also experience this issue - steps to reproduce are the same as mentioned above. I am on the latest version 5.2.8-49, but have experienced this issue the whole time I've been using BookPlayer (at least a year or two). This app is the only one that exhibits this behavior.
🌎 Environment
💬 Description
So this one is a revisit of #541 which was closed.
The core of the issue is: When BookPlayer is playing it prevents the screen from sleeping.
This is a bug since:
Additional note: I like using this app to listen to books at night in a dark room to unwind. Having the audio controls always on screen is annoying and kills the immersive experience I seek. It is also very problematic with iOS's tilt to awake feature which easily triggers a lock screen awaken event (I have a wireless charging stand so this always happens).
I was particularly intrigued because this bug only happens while charging.
I've narrowed down a possible trigger in the code for you to investigate:
https://github.com/TortugaPower/BookPlayer/blob/72d881dab5034de16a16d2a1e549fd447a3032bb/BookPlayer/Player/PlayerViewController.swift#L340
If I understand the logic correctly
updateAutoLock()
will always setUIApplication.shared.isIdleTimerDisabled = true
which will prevent screen sleep regardless of settings when power is connected.Also
UIApplication.shared.isIdleTimerDisabled = UIDevice.current.batteryState != .unplugged
means that this will default to "true" as long as the phone is being charged and "false" otherwise.In other words the app's logic prevents
UIApplication.shared.isIdleTimerDisabled
from being set to false while playback during charging regardless of app settings "Disable Autolock" OFF and "Only when connected to power" OFF.Although I don't have a pull request or sample project since I'm not an iOS developer I'm fairly confident about the logic. Please consider adding proper setting of
UIApplication.shared.isIdleTimerDisabled
in accordance with preferences while respecting default system values if possible.🦶 Reproduction Steps
Steps to reproduce the behavior, provide an example of the command line issued:
🤔 Expected Results
I want it to sleep in accordance with the settings app value like other major audio apps including Apple Music.
😲 Actual Results
End up staring at playback time on audio book instead of enjoying book :(
🤝 Relationships