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
|
- (void)removeFromSuperview
|
||||||
{
|
{
|
||||||
[_player pause];
|
[_player pause];
|
||||||
|
if (_playbackRateObserverRegistered) {
|
||||||
[_player removeObserver:self forKeyPath:playbackRate];
|
[_player removeObserver:self forKeyPath:playbackRate];
|
||||||
_playbackRateObserverRegistered = NO;
|
_playbackRateObserverRegistered = NO;
|
||||||
|
}
|
||||||
_player = nil;
|
_player = nil;
|
||||||
|
|
||||||
[self removePlayerLayer];
|
[self removePlayerLayer];
|
||||||
|
Loading…
Reference in New Issue
Block a user