Skip to content

Commit

Permalink
fix(iOS): completely release player
Browse files Browse the repository at this point in the history
  • Loading branch information
hans00 committed Jun 11, 2024
1 parent 9d76391 commit 69831fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/ReactNativeVideoPlayerView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ - (void)didMoveToSuperview
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_player removeObserver:self forKeyPath:STATUS_KEY];
[_player removeObserver:self forKeyPath:CURR_STATUS_KEY];
[_player removeObserver:self forKeyPath:CURR_BUFF_EMPTY_KEY];
[_player removeObserver:self forKeyPath:CURR_CONTINUE_PLAY_KEY];
if (_timeObserver) {
[_player removeTimeObserver:_timeObserver];
}
[_player replaceCurrentItemWithPlayerItem:nil];
_player = nil;
}

- (void)playerItemDidPlayToEndTime:(NSNotification *)notification
Expand Down

0 comments on commit 69831fe

Please sign in to comment.