From 0c32e235de3ede82dd9ecee33bee859e20c6b398 Mon Sep 17 00:00:00 2001 From: Marlon Andrade Date: Wed, 26 Feb 2020 16:55:20 +0100 Subject: [PATCH 1/2] [fix] dont set reactViewController view frame to whole screen - only set the view frame when video is being presented as fullScreen this fixes the case on any time you have a react view that displays the video, but its being rendered with controls but not as a full screen (ie. easily reproducible when you have a tabbar for instance - the reactViewController.view frame shouldnt be the whole screen bounds). --- ios/Video/RCTVideo.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Video/RCTVideo.m b/ios/Video/RCTVideo.m index 113d9f2364..dde0dcb6f4 100644 --- a/ios/Video/RCTVideo.m +++ b/ios/Video/RCTVideo.m @@ -708,10 +708,10 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N if (!CGRectEqualToRect(oldRect, newRect)) { if (CGRectEqualToRect(newRect, [UIScreen mainScreen].bounds)) { NSLog(@"in fullscreen"); - } else NSLog(@"not fullscreen"); - [self.reactViewController.view setFrame:[UIScreen mainScreen].bounds]; - [self.reactViewController.view setNeedsLayout]; + [self.reactViewController.view setFrame:[UIScreen mainScreen].bounds]; + [self.reactViewController.view setNeedsLayout]; + } else NSLog(@"not fullscreen"); } return; From 3dfc8ed7d670118817c575c04d8d8289fcf75938 Mon Sep 17 00:00:00 2001 From: Marlon Andrade Date: Wed, 26 Feb 2020 17:32:35 +0100 Subject: [PATCH 2/2] [chore] update CHAGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d43a044bc..7b52c98c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Changelog +### Version 5.1.0-alpha6 + +- Fix iOS bug which would break size of views when video is displayed with controls on a non full-screen React view. [#1931](https://github.com/react-native-community/react-native-video/pull/1931) + ### Version 5.1.0-alpha5 - Add support for react-native Windows Cpp/WinRT [#1893]((https://github.com/react-native-community/react-native-video/pull/1893))