From bd8ad569280bc40ca1695322c7ca8e798f16d00e Mon Sep 17 00:00:00 2001 From: Adam Ivancza Date: Thu, 14 May 2020 12:26:17 +0200 Subject: [PATCH] Changes from https://github.com/react-native-community/react-native-video/pull/1669 --- ios/Video/RCTVideo.m | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index dde0dcb6f4..0be6c1cc8e 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -711,7 +711,27 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N [self.reactViewController.view setFrame:[UIScreen mainScreen].bounds]; [self.reactViewController.view setNeedsLayout]; - } else NSLog(@"not fullscreen"); + if (!_fullscreenPlayerPresented && _controls) { + _fullscreenPlayerPresented = YES; + if(self.onVideoFullscreenPlayerWillPresent) { + self.onVideoFullscreenPlayerWillPresent(@{@"target": self.reactTag}); + } + if(self.onVideoFullscreenPlayerDidPresent) { + self.onVideoFullscreenPlayerDidPresent(@{@"target": self.reactTag}); + } + } + } else { + NSLog(@"not fullscreen"); + if (_fullscreenPlayerPresented && _controls) { + _fullscreenPlayerPresented = NO; + if(self.onVideoFullscreenPlayerWillDismiss) { + self.onVideoFullscreenPlayerWillDismiss(@{@"target": self.reactTag}); + } + if(self.onVideoFullscreenPlayerDidDismiss) { + self.onVideoFullscreenPlayerDidDismiss(@{@"target": self.reactTag}); + } + } + } } return;