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