Commit 901f0cc9 authored by Stanisław Chmiela's avatar Stanisław Chmiela
Browse files

Save current state of observing in _playbackRateObserverRegistered property

parent 5506805a
Loading
Loading
Loading
Loading
+2 −0
Changes for RCTVideo.m: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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
@@ -670,6 +671,7 @@ static NSString *const playbackRate = @"rate";
{
  [_player pause];
    [_player removeObserver:self forKeyPath:playbackRate];
    _playbackRateObserverRegistered = NO;
  _player = nil;

  [self removePlayerLayer];