Minor performance improvement

This commit is contained in:
Arkadiusz Fal
2022-08-20 22:28:31 +02:00
parent c3e2e5c258
commit b5f8a0fba2
3 changed files with 49 additions and 28 deletions

View File

@@ -342,6 +342,13 @@ final class MPVBackend: PlayerBackend {
return
}
#if !os(macOS)
guard UIApplication.shared.applicationState != .background else {
self.logger.info("not performing controls updates in background")
return
}
#endif
self.playerTime.currentTime = self.currentTime ?? .zero
self.playerTime.duration = self.playerItemDuration ?? .zero
}