Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video][ios] Fix unable to call presentFullScreenPlayer twice #8343

Merged
merged 3 commits into from May 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/expo-av/CHANGELOG.md
Expand Up @@ -8,4 +8,5 @@

### 🐛 Bug fixes

- Fix unable to call presentFullScreenPlayer twice. ([#8343](https://github.com/expo/expo/pull/8343) by [@IjzerenHein](https://github.com/IjzerenHein))
- Fixed `Plaback.loadAsync()` return type. ([#7559](https://github.com/expo/expo/pull/7559) by [@awinograd](https://github.com/awinograd))
6 changes: 3 additions & 3 deletions packages/expo-av/ios/EXAV/Video/EXVideoView.m
Expand Up @@ -243,14 +243,14 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
CGRect viewBounds = [change[@"new"] CGRectValue];
CGRect screen = [[UIScreen mainScreen] bounds];

if (viewBounds.size.height != screen.size.height && viewBounds.size.width != screen.size.width && _fullscreenPlayerPresented) {
if (viewBounds.size.height != screen.size.height && viewBounds.size.width != screen.size.width && _fullscreenPlayerPresented && !_fullscreenPlayerViewController) {
// Fullscreen player is being dismissed
_fullscreenPlayerPresented = false;
_fullscreenPlayerPresented = NO;
[self _callFullscreenCallbackForUpdate:EXVideoFullscreenUpdatePlayerWillDismiss];
[self _callFullscreenCallbackForUpdate:EXVideoFullscreenUpdatePlayerDidDismiss];
} else if (viewBounds.size.height == screen.size.height && viewBounds.size.width == screen.size.width && !_fullscreenPlayerPresented) {
// Fullscreen player is being presented
_fullscreenPlayerPresented = true;
_fullscreenPlayerPresented = YES;
[self _callFullscreenCallbackForUpdate:EXVideoFullscreenUpdatePlayerWillPresent];
[self _callFullscreenCallbackForUpdate:EXVideoFullscreenUpdatePlayerDidPresent];
} else {
Expand Down