forked from shadowfacts/Tusker
Fix AVPlayer periodic time observers not being removed
This commit is contained in:
parent
844d4056e3
commit
966a906436
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue