Skip to content

Commit

Permalink
Fix full screen mode on iOS 8
Browse files Browse the repository at this point in the history
  • Loading branch information
priore committed May 29, 2016
1 parent a996ab0 commit f3fe58c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion AVPlayerOverlay.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AVPlayerOverlay'
s.version = '1.5.0'
s.version = '1.5.1'
s.summary = 'AVPlayer with custom controls and full screen features.'
s.license = 'MIT'
s.ios.platform = '7.1'
Expand Down
8 changes: 4 additions & 4 deletions AVPlayerOverlay/AVPlayer/AVPlayerOverlayVC.m
Expand Up @@ -309,18 +309,17 @@ - (void)didFullscreenButtonSelected:(id)sender
self.window = [[UIWindow alloc] initWithFrame:_currentFrame];
_window.backgroundColor = [UIColor blackColor];
_window.windowLevel = UIWindowLevelNormal;

//[_window.layer addSublayer:parent.view.layer];
[_window makeKeyAndVisible];

_window.rootViewController = parent;
parent.view.frame = _window.bounds;

[self willFullScreenModeFromParentViewController:parent];
[UIView animateKeyframesWithDuration:0.5
delay:0
options:UIViewKeyframeAnimationOptionLayoutSubviews
animations:^{
_window.frame = _mainWindow.frame;
_window.frame = _mainWindow.bounds;
} completion:^(BOOL finished) {
_fullscreenButton.transform = CGAffineTransformMakeScale(-1.0, -1.0);
_isFullscreen = YES;
Expand All @@ -332,7 +331,7 @@ - (void)didFullscreenButtonSelected:(id)sender

[self willNormalScreenModeToParentViewController:parent];

_window.frame = _mainWindow.frame;
_window.frame = _mainWindow.bounds;
[UIView animateKeyframesWithDuration:0.5
delay:0
options:UIViewKeyframeAnimationOptionLayoutSubviews
Expand All @@ -345,6 +344,7 @@ - (void)didFullscreenButtonSelected:(id)sender

[_mainParent addChildViewController:parent];
[_containerView addSubview:parent.view];
parent.view.frame = _containerView.bounds;
[parent didMoveToParentViewController:_mainParent];

[_mainWindow makeKeyAndVisible];
Expand Down

0 comments on commit f3fe58c

Please sign in to comment.