Remove observer providing context

This commit is contained in:
Stanisław Chmiela 2016-05-19 20:27:23 +02:00
parent e7337227fe
commit b6dc7c469b

View File

@ -227,7 +227,7 @@ static NSString *const playbackRate = @"rate";
_player.actionAtItemEnd = AVPlayerActionAtItemEndNone; _player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
if (_playbackRateObserverRegistered) { if (_playbackRateObserverRegistered) {
[_player removeObserver:self forKeyPath:playbackRate]; [_player removeObserver:self forKeyPath:playbackRate context:nil];
_playbackRateObserverRegistered = NO; _playbackRateObserverRegistered = NO;
} }
[_player addObserver:self forKeyPath:playbackRate options:0 context:nil]; [_player addObserver:self forKeyPath:playbackRate options:0 context:nil];
@ -676,7 +676,7 @@ static NSString *const playbackRate = @"rate";
{ {
[_player pause]; [_player pause];
if (_playbackRateObserverRegistered) { if (_playbackRateObserverRegistered) {
[_player removeObserver:self forKeyPath:playbackRate]; [_player removeObserver:self forKeyPath:playbackRate context:nil];
_playbackRateObserverRegistered = NO; _playbackRateObserverRegistered = NO;
} }
_player = nil; _player = nil;