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 8235085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:41:09+00:00 2026-06-07T18:41:09+00:00

In an iOS5 application for iPhone 4/4s I have a UIViewController with an MPMoviePlayerController

  • 0

In an iOS5 application for iPhone 4/4s I have a UIViewController with an MPMoviePlayerController view added to its view:

[self.view insertSubview:self.fullscreenMoviePlayerController.view atIndex:2];

The UIViewController only supports landscape orientation:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation 
{
  // Return YES for supported orientations.
  return  interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
          interfaceOrientation == UIInterfaceOrientationLandscapeRight;

}

this correctly locks rotation to only landscape. However when I set the MPVideoPlayerController to display fullscreen, this is ignored and the video is no longer constrained to landscape and rotates to whatever orientation the phone is held in.

How can I prevent MPMoviePlayerController’s video from rotating to Portrait orientations in fullscreen? It is crucial that the video does not rotate when the phone is rotated to portrait.

I have tried subclassing MPVideoPlayerController and overriding shouldAutorotateToInterfaceOrientation: but this has no effect.

The MPMoviePlayerController is only one part of the view, so using an MPMoviePlayerViewCotroller is absolutely not an option.

  • 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-06-07T18:41:11+00:00Added an answer on June 7, 2026 at 6:41 pm

    This seems to be rather difficult if you really want to avoid using MPMoviePlayerViewController.
    One option, that seems to work even if you have it in fullscreen, is to manually set the frame of the MPMoviePlayerController’s view.
    (Note that in other iOS issues, sometimes using the background view has produced different results, but it’s worth a shot).

    MyMPMoviePlayerController.view.frame = CGRectMake(0, 0, your numbers, here);
    

    However, Apple, in their docs, says that the controller’s frame should be set to the frame of it’s parent view.

    [MyMPMoviePlayerController.view setFrame: parentView.bounds];
    

    The less elegant solution, but one that might work even if that one doesn’t is this:

    Listen for the UIDeviceOrientationDidChangeNotification and take the movie player’s view. Apply a transfrom, bounds, and center (or frame, etc) on it so that it still fits in the landscape view. Essentially transform it back each time it tries to rotate away. (This is all assuming that you really cannot keep it from rotating with shouldAutorotateToInterfaceOrientation:).

    The only issue here is that it may keep the movie in portrait but screw around with the view, which is not the desired outcome.

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

Sidebar

Related Questions

I am trying to set up a simple single-view iOS5 iPhone application (with AppDelegates,
I have customized the camera with custom buttons(UIButton) by overlay view. My iPhone application
I have ios5 installed on my iPhone device, I am developing an application in
I have just released a iPhone application. it supports from iOS 4.2. now i
I have developed an iPhone application which should support iOS4 and iOS5 based iPhone/iPad.
In my iOS5 iPhone application, i'm setting the tint color of search bar using
info: iOS5, xcode4.3.2, iphone5 Create tab view controller application from xcode template wizard. Following
I am working on an application for the iPhone (iOS 5). What I have
I create a brand new Single View Application iPhone app in Xcode 4.2, it
In my iPhone app, the application receives its data from a server in XML

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.