Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7066719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:06:53+00:00 2026-05-28T05:06:53+00:00

I have a MPMoviePlayerController object that plays a video fullscreen in either portrait or

  • 0

I have a MPMoviePlayerController object that plays a video fullscreen in either portrait or landscape. If I rotate orientation while the video is playing and do the rotation within a few seconds after the video starts playing and the video status bar is visible, when the video ends my navigation bar is perfect. But if I wait until the video status bar disappears a few seconds into the video playing and then rotate orientation, when the video ends my navigationBar is partially hidden behind the status bar, like pushed up.

Have you ever seen something like this?

I am able to recreate this bug easily. I created a new Single View App and simply added a button and a navigation bar. If I rotate orientation while video is playing, tap to enable fullscreen and the video status bar is still visible, when the video finishes, all is good. But, if I wait to rotate after the video status bar disappears, when I rotate and the video finishes, the navigationBar is under the status bar. See image:

iPhone Image

Here is the simple code I am using:

- (void) playMovie {
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource: @"movie" ofType: @"mov"]];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL: url];

[[NSNotificationCenter defaultCenter] addObserver: self 
                                         selector: @selector(moviePlayBackDidFinish:) 
                                             name: MPMoviePlayerPlaybackDidFinishNotification 
                                           object: moviePlayer];

moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;

[self.view addSubview: moviePlayer.view];
[moviePlayer setFullscreen: YES animated: YES];

- (void) moviePlayBackDidFinish: (NSNotification *) notification
    MPMoviePlayerController *player = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver: self 
                                                name: MPMoviePlayerPlaybackDidFinishNotification 
                                              object: player];

if ([player respondsToSelector: @selector(setFullscreen:animated:)])
{
    [player.view removeFromSuperview];
}

Here is where I am currently at with the suggestions given below. I must have something wrong because unfortunately I still have the same problem.

Here is the method onPlayerWillExitFullScreen

UIView *view = [[[UIApplication sharedApplication] delegate].window.subviews lastObject];    
if (view) {
    [view removeFromSuperview];
    [[[UIApplication sharedApplication] delegate].window addSubview:view]; 
}

MPMoviePlayerController *player = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver: self 
                                                name: MPMoviePlayerWillExitFullscreenNotification 
                                              object: player];    

and here is my current playMovie method:

 NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource: @"movie" ofType: @"mov"]];
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL: url];

[[NSNotificationCenter defaultCenter] addObserver: self 
                                         selector: @selector(moviePlayBackDidFinish:) 
                                             name: MPMoviePlayerPlaybackDidFinishNotification 
                                           object: moviePlayer];

[[NSNotificationCenter defaultCenter]addObserver: self
                                        selector: @selector(onPlayerWillExitFullScreen:) 
                                            name: MPMoviePlayerWillExitFullscreenNotification 
                                          object: self.moviePlayer];

moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayer.shouldAutoplay = YES;

[self.view addSubview: moviePlayer.view];
[moviePlayer setFullscreen: YES animated: YES];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:06:53+00:00Added an answer on May 28, 2026 at 5:06 am

    Ok, so I found this freaking same bug all over my app first in a UIWebView then in a MPMoviePlayerController, I solved this placing this code in my view controller.

    - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
        [self.navigationController setNavigationBarHidden:YES animated:YES];
        [self.navigationController setNavigationBarHidden:NO animated:YES];
    }
    

    Tricky bugs, tricky fixes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with my code that plays a video file. Whenever I
I have been using MPMoviePlayerController to play mp4 file. Video is playing fine but
I have a media player app that is playing music with MPMoviePlayerController. I need
I have an app that streams video from the net and plays it using
I have video in my project. I play it with MPMoviePlayerController but app will
You might have seen video through you tube in iPhone. Normal MPMoviePlayerController has previous,
I am having a crash issue while playing video in iphone 4.0 OS. Actually,
I have a problem with MPMoviePlayerController.When I am watching a video, and hit the
I have an universal application that plays movies from the internet. It has to
I have a MPMoviePlayerController on my iPad app that works good when its frame

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.