From 858ed514c294bd69ad42465e2b46f4019a8482f0 Mon Sep 17 00:00:00 2001 From: kintan Date: Tue, 3 Oct 2023 19:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8deinit=E6=89=8D=E6=B8=85=E7=A9=BAprefe?= =?UTF-8?q?rredDisplayCriteria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift b/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift index 7c7df4fb3..948463605 100644 --- a/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift +++ b/Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift @@ -206,7 +206,7 @@ open class KSPlayerLayer: UIView { } NotificationCenter.default.removeObserver(self) MPNowPlayingInfoCenter.default().nowPlayingInfo = nil - #if os(tvOS) + #if os(tvOS) || os(xrOS) UIApplication.shared.windows.first?.avDisplayManager.preferredDisplayCriteria = nil #endif } @@ -277,9 +277,6 @@ open class KSPlayerLayer: UIView { player.playbackVolume = 1 UIApplication.shared.isIdleTimerDisabled = false MPNowPlayingInfoCenter.default().nowPlayingInfo = nil - #if os(tvOS) - UIApplication.shared.windows.first?.avDisplayManager.preferredDisplayCriteria = nil - #endif } open func seek(time: TimeInterval, autoPlay: Bool, completion: @escaping ((Bool) -> Void)) {