Skip to content

Commit

Permalink
Merge pull request #1 from wildseansy/master
Browse files Browse the repository at this point in the history
  • Loading branch information
davrosull authored Apr 19, 2018
2 parents df02fa9 + 28bae40 commit 84e9ede
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ios/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ -(void)removePlayerTimeObserver
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[self removePlayerItemObservers];
[self removePlayerLayer];
[self removePlayerItemObservers];
[_player removeObserver:self forKeyPath:playbackRate context:nil];
}

Expand Down Expand Up @@ -252,9 +252,6 @@ - (void)addPlayerItemObservers
* observer set */
- (void)removePlayerItemObservers
{
if (_playerLayer) {
[_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath];
}
if (_playerItemObserversSet) {
[_playerItem removeObserver:self forKeyPath:statusKeyPath];
[_playerItem removeObserver:self forKeyPath:playbackBufferEmptyKeyPath];
Expand All @@ -268,13 +265,13 @@ - (void)removePlayerItemObservers

- (void)setSrc:(NSDictionary *)source
{
[self removePlayerLayer];
[self removePlayerTimeObserver];
[self removePlayerItemObservers];
_playerItem = [self playerItemForSource:source];
[self addPlayerItemObservers];

[_player pause];
[self removePlayerLayer];
[_playerViewController.view removeFromSuperview];
_playerViewController = nil;

Expand Down

0 comments on commit 84e9ede

Please sign in to comment.