Fix AVPlayer periodic time observers not being removed

This commit is contained in:
Shadowfacts 2024-05-23 14:29:56 -04:00
parent 844d4056e3
commit 966a906436
1 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,15 @@ class VideoControlsViewController: UIViewController {
fatalError("init(coder:) has not been implemented")
}
deinit {
if let timestampObserverToken {
player.removeTimeObserver(timestampObserverToken)
}
if let scrubberObserverToken {
player.removeTimeObserver(scrubberObserverToken)
}
}
override func viewDidLoad() {
super.viewDidLoad()