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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:51:57+00:00 2026-06-11T18:51:57+00:00

I am working on a universal application that starts with a really short intro

  • 0

I am working on a universal application that starts with a really short intro video. So I simply add a MPMoviePlayerViewController and modally present it. On the iPhone everything works fine even if I play the video in landscape mode. But on the iPad the video always plays in portrait mode no matter what interface orientation the device currently has. I searched for hours and tried a lot of different things like CGAffineTransformation or adding a new view, but nothing seems to work. Here is the code that I work with:

    NSString *filePath = [[NSBundle mainBundle] pathForResource:videoName ofType:@"mp4"];
    NSURL *fileURL = [NSURL fileURLWithPath:filePath];  

    self.startupController = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
    [self.startupController.moviePlayer setControlStyle:MPMovieControlStyleNone];
    [self.startupController.moviePlayer setScalingMode:MPMovieScalingModeAspectFit];
    [self.startupController.moviePlayer setFullscreen:YES];        
    [self presentModalViewController:self.startupController animated:NO];

Do you have any idea how I can fix this issue? In my opinion this should be a simple feature offered by Apple, but sometimes the easiest things are the ones I have to worry about most…

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

    Here is how I did it.
    First, listen to this notification

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectOrientation) name:@"UIDeviceOrientationDidChangeNotification" object:nil];
    

    Then implement this :

    - (void)detectOrientation {
        NSLog(@"handling orientation");
        [self setMoviePlayerViewOrientation:[[UIDevice currentDevice] orientation]];
    }
    
    
    - (void)setMoviePlayerViewOrientation:(UIDeviceOrientation)orientation {
    if (lwvc != nil)
        return;
    if (moviePlayerController.playbackState == MPMoviePlaybackStateStopped) return;
    //Rotate the view!
    CGFloat degree = 0;
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.1];
    switch (orientation) {
        case UIDeviceOrientationPortrait:
        case UIDeviceOrientationPortraitUpsideDown:
            degree = 0;
            moviePlayerController.view.bounds = CGRectMake(0, 0, 320, height);
            break;
        case UIDeviceOrientationLandscapeLeft:
            degree = 90;
            moviePlayerController.view.bounds = CGRectMake(0, 0, height, 320);
            break;
        case UIDeviceOrientationLandscapeRight:
            degree = -90;
            moviePlayerController.view.bounds = CGRectMake(0, 0, height, 320);
            break;
        default:
            break;
    }
    lastOrientation = orientation;
    CGAffineTransform cgCTM = CGAffineTransformMakeRotation((degree) * M_PI / 180);
    moviePlayerController.view.transform = cgCTM;
    [UIView commitAnimations];
    [[UIApplication sharedApplication] setStatusBarOrientation:orientation];
    }
    

    So the trick is just using transformation

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

Sidebar

Related Questions

I'm working on an iPhone application (not an universal one). When I launch this
I'm working on a universal iPhone/iPad application. I'm using MonoTouch, but I can take
I made a universal application that contains NIB files for both ipad and iphone
I have a fairly simple iPhone application that I want to have run on
I am working on a universal app, I used UISplitViewController in doing iPad application.
I am working on a universal app that should be able to run on
I am working on a simple universal ios app that displays images in a
I am working on a Universal iOS Application on Xcode 4 . It's my
I am working on a universal application where I am stuck at one point.
I working on a universal iOS app that gets news from an RSS feed.

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.