diff --git a/RCTVideo.m b/RCTVideo.m index 46f691bc..5a6d80d5 100644 --- a/RCTVideo.m +++ b/RCTVideo.m @@ -226,6 +226,7 @@ static NSString *const playbackRate = @"rate"; _player = [AVPlayer playerWithPlayerItem:_playerItem]; _player.actionAtItemEnd = AVPlayerActionAtItemEndNone; [_player addObserver:self forKeyPath:playbackRate options:0 context:nil]; + _playbackRateObserverRegistered = YES; const Float64 progressUpdateIntervalMS = _progressUpdateInterval / 1000; // @see endScrubbing in AVPlayerDemoPlaybackViewController.m of https://developer.apple.com/library/ios/samplecode/AVPlayerDemo/Introduction/Intro.html @@ -669,7 +670,8 @@ static NSString *const playbackRate = @"rate"; - (void)removeFromSuperview { [_player pause]; - [_player removeObserver:self forKeyPath:playbackRate]; + [_player removeObserver:self forKeyPath:playbackRate]; + _playbackRateObserverRegistered = NO; _player = nil; [self removePlayerLayer];