Loading RCTVideo.m +13 −6 Changes for RCTVideo.m: 13 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ static NSString *const statusKeyPath = @"status"; static NSString *const playbackLikelyToKeepUpKeyPath = @"playbackLikelyToKeepUp"; static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; static NSString *const readyForDisplayKeyPath = @"readyForDisplay"; @implementation RCTVideo { Loading Loading @@ -213,8 +214,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; [self addPlayerItemObservers]; [_player pause]; [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [_playerViewController.view removeFromSuperview]; _playerViewController = nil; Loading Loading @@ -505,6 +505,8 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; _playerLayer.frame = self.bounds; _playerLayer.needsDisplayOnBoundsChange = YES; [_playerLayer addObserver:self forKeyPath:readyForDisplayKeyPath options:NSKeyValueObservingOptionNew context:nil]; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; } Loading @@ -517,8 +519,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; _controls = controls; if( _controls ) { [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [self usePlayerViewController]; } else Loading @@ -530,6 +531,13 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; } } - (void)removePlayerLayer { [_playerLayer removeFromSuperlayer]; [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; _playerLayer = nil; } #pragma mark - RCTVideoPlayerViewControllerDelegate - (void)videoPlayerViewControllerWillDismiss:(AVPlayerViewController *)playerViewController Loading Loading @@ -615,8 +623,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; [_player pause]; _player = nil; [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [_playerViewController.view removeFromSuperview]; _playerViewController = nil; Loading RCTVideoManager.m +2 −1 Changes for RCTVideoManager.m: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ RCT_EXPORT_MODULE(); @"onVideoFullscreenPlayerWillPresent", @"onVideoFullscreenPlayerDidPresent", @"onVideoFullscreenPlayerWillDismiss", @"onVideoFullscreenPlayerDidDismiss" @"onVideoFullscreenPlayerDidDismiss", @"onReadyForDisplay" ]; } Loading Loading
RCTVideo.m +13 −6 Changes for RCTVideo.m: 13 added lines, 6 removed lines. Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ static NSString *const statusKeyPath = @"status"; static NSString *const playbackLikelyToKeepUpKeyPath = @"playbackLikelyToKeepUp"; static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; static NSString *const readyForDisplayKeyPath = @"readyForDisplay"; @implementation RCTVideo { Loading Loading @@ -213,8 +214,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; [self addPlayerItemObservers]; [_player pause]; [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [_playerViewController.view removeFromSuperview]; _playerViewController = nil; Loading Loading @@ -505,6 +505,8 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; _playerLayer.frame = self.bounds; _playerLayer.needsDisplayOnBoundsChange = YES; [_playerLayer addObserver:self forKeyPath:readyForDisplayKeyPath options:NSKeyValueObservingOptionNew context:nil]; [self.layer addSublayer:_playerLayer]; self.layer.needsDisplayOnBoundsChange = YES; } Loading @@ -517,8 +519,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; _controls = controls; if( _controls ) { [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [self usePlayerViewController]; } else Loading @@ -530,6 +531,13 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; } } - (void)removePlayerLayer { [_playerLayer removeFromSuperlayer]; [_playerLayer removeObserver:self forKeyPath:readyForDisplayKeyPath]; _playerLayer = nil; } #pragma mark - RCTVideoPlayerViewControllerDelegate - (void)videoPlayerViewControllerWillDismiss:(AVPlayerViewController *)playerViewController Loading Loading @@ -615,8 +623,7 @@ static NSString *const playbackBufferEmptyKeyPath = @"playbackBufferEmpty"; [_player pause]; _player = nil; [_playerLayer removeFromSuperlayer]; _playerLayer = nil; [self removePlayerLayer]; [_playerViewController.view removeFromSuperview]; _playerViewController = nil; Loading
RCTVideoManager.m +2 −1 Changes for RCTVideoManager.m: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -28,7 +28,8 @@ RCT_EXPORT_MODULE(); @"onVideoFullscreenPlayerWillPresent", @"onVideoFullscreenPlayerDidPresent", @"onVideoFullscreenPlayerWillDismiss", @"onVideoFullscreenPlayerDidDismiss" @"onVideoFullscreenPlayerDidDismiss", @"onReadyForDisplay" ]; } Loading