@AVFoundation Engineers, I get this bug repeatedly when using AVComposition & AVVideoComposition. Sometimes AVPlayer seek to time completion handler is not called. I check for a flag whether seek is in progress before placing another seek request. But if the completion handler is never invoked, all further seeks stall as flag remains true. What is a reliable way to know seek is not in progress before initiating another seek request.
playerSeeking = true
player.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) { [weak self] completed
if !completed {
NSLog("Seek not completed \(time.seconds)")
}
guard let self = self else {
return
}
self.playerSeeking = false
if self.player.rate == 0.0 {
self.updateButtonStates()
}
}