mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-06 03:48:41 +02:00
iOS fix infinite loop in AVPlayer observer
This commit is contained in:
@@ -253,13 +253,15 @@ class AudioPlayer: NSObject {
|
||||
if playerStatus == .readyToPlay {
|
||||
self.updateNowPlaying()
|
||||
|
||||
let firstReady = self.status < 0
|
||||
self.status = 0
|
||||
if self.playWhenReady {
|
||||
seek(playbackSession.currentTime)
|
||||
self.playWhenReady = false
|
||||
self.play()
|
||||
} else if (firstReady) { // Only seek on first readyToPlay
|
||||
seek(playbackSession.currentTime)
|
||||
}
|
||||
|
||||
seek(playbackSession.currentTime)
|
||||
}
|
||||
}
|
||||
} else if context == &playerContext {
|
||||
|
||||
Reference in New Issue
Block a user