Skip to content

Commit

Permalink
在deinit才清空preferredDisplayCriteria
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Oct 3, 2023
1 parent 708a299 commit 858ed51
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 858ed51

Please sign in to comment.