mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Minor performance improvement
This commit is contained in:
@@ -489,6 +489,18 @@ final class AVPlayerBackend: PlayerBackend {
|
||||
if let currentTime = self.currentTime {
|
||||
self.model.handleSegments(at: currentTime)
|
||||
}
|
||||
|
||||
#if !os(macOS)
|
||||
guard UIApplication.shared.applicationState != .background else {
|
||||
print("not performing controls updates in background")
|
||||
return
|
||||
}
|
||||
#endif
|
||||
|
||||
if self.controlsUpdates {
|
||||
self.playerTime.duration = self.playerItemDuration ?? .zero
|
||||
self.playerTime.currentTime = self.currentTime ?? .zero
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user