Remove observer only if it has been registered
Happens if someone creates Video component, but doesn't set src to it.
This commit is contained in:
parent
88e47159d7
commit
e7337227fe
@ -675,8 +675,10 @@ static NSString *const playbackRate = @"rate";
|
||||
- (void)removeFromSuperview
|
||||
{
|
||||
[_player pause];
|
||||
if (_playbackRateObserverRegistered) {
|
||||
[_player removeObserver:self forKeyPath:playbackRate];
|
||||
_playbackRateObserverRegistered = NO;
|
||||
}
|
||||
_player = nil;
|
||||
|
||||
[self removePlayerLayer];
|
||||
|
Loading…
Reference in New Issue
Block a user