mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-05 18:45:47 +02:00
iOS fix infinite loop in AVPlayer observer
This commit is contained in:
parent
6cea0ba03d
commit
3f2b3f2e9c
1 changed files with 4 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue