Rewrite sleep timer logic again

This commit is contained in:
ronaldheft
2022-09-02 18:22:42 -04:00
parent dc8852eb0d
commit c14f6ec4c2
3 changed files with 111 additions and 129 deletions
+2 -4
View File
@@ -70,13 +70,11 @@ class PlayerHandler {
}
public static func setSleepTime(secondsUntilSleep: Double) {
guard let currentTime = self.player?.getCurrentTime() else { return }
let stopAt = secondsUntilSleep + currentTime
self.player?.setSleepTime(stopAt: stopAt, scaleBasedOnSpeed: true)
self.player?.setSleepTimer(secondsUntilSleep: secondsUntilSleep)
}
public static func setChapterSleepTime(stopAt: Double) {
self.player?.setSleepTime(stopAt: stopAt, scaleBasedOnSpeed: false)
self.player?.setChapterSleepTimer(stopAt: stopAt)
}
public static func increaseSleepTime(increaseSeconds: Double) {