This commit is contained in:
Francesco 2025-06-02 21:41:56 +02:00
parent 5cfb0acc92
commit c0771d8832

View file

@ -428,7 +428,20 @@ class CustomMediaPlayerViewController: UIViewController, UIGestureRecognizerDele
NotificationCenter.default.removeObserver(foregroundToken)
}
inactivityTimer?.invalidate()
updateTimer?.invalidate()
lockButtonTimer?.invalidate()
dimButtonTimer?.invalidate()
loadedTimeRangesObservation?.invalidate()
playerTimeControlStatusObserver?.invalidate()
volumeObserver?.invalidate()
player.replaceCurrentItem(with: nil)
player.pause()
playerViewController = nil
sliderHostingController = nil
try? AVAudioSession.sharedInstance().setActive(false)
}
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {