forked from shadowfacts/Tusker
Fix AVPlayer periodic time observers not being removed
This commit is contained in:
parent
cb3fd43dbd
commit
d4e82d6e7a
|
@ -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