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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:49:43+00:00 2026-06-01T02:49:43+00:00

I have a requirement where the interface, which contains a video, is portrait only

  • 0

I have a requirement where the interface, which contains a video, is portrait only but when the user rotates to landscape the video goes to full screen and starts playing then when the video reaches the end or the user clicks done, the video exits full screen and the interface is still portrait. I have tried to use shouldAutorotateToInterfaceOrientation: methods which works for starting the video. But I cannot get the screen to rotate back again. I have decided to instead use shouldAutorotateToInterfaceOrientation: and create my own view controller to handle the video only and use -[UIView setTransform:] to rotate the video, but rotations only work if I disable going to full screen here is part of my code

- (void)deviceOrientationDidChangeNotification:(NSNotification *)aNotification
{
    switch ([[UIDevice currentDevice] orientation])
    {
    case UIDeviceOrientationPortrait:
    case UIDeviceOrientationPortraitUpsideDown:
        [self setFullscreen:NO animated:YES];
        break;
    case UIDeviceOrientationLandscapeLeft:
    case UIDeviceOrientationLandscapeRight:
        [self.moviePlayerController play];
        [self setFullscreen:YES animated:YES];
        break;
    default:
        break;
    }
}

    - (void)setFullscreen:(BOOL)aFullScreen animated:(BOOL)anAnimated
    {
        if( aFullScreen )
        {
            switch ([[UIDevice currentDevice] orientation])
            {
                case UIDeviceOrientationLandscapeLeft:
                case UIDeviceOrientationPortraitUpsideDown:
                    self.moviePlayerController.view.transform = CGAffineTransformMakeRotation(M_PI_2);
                    break;
                case UIDeviceOrientationPortrait:
                case UIDeviceOrientationLandscapeRight:
                    self.moviePlayerController.view.transform = CGAffineTransformMakeRotation(M_PI+M_PI_2);
                    break;
                default:
                    break;
            }
        }
        else
            self.moviePlayerController.view.transform = CGAffineTransformMakeRotation(0);
        [self.moviePlayerController setFullscreen:aFullScreen animated:anAnimated];     // comment this out and rotation works
    }

Can anybody give any advice, I am now think I should implement my own transition to full screen to get it to work, but I thought I would get some feedback first.

  • 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-01T02:49:44+00:00Added an answer on June 1, 2026 at 2:49 am

    I’ve been flummoxed by this, too … wrestled with device and view rotations and whatnot, and even managed to get things mostly working, but I was continually finding one more case that would spoil it (e.g. user going in and out of full screen while rotated, mysteriously losing the status bar after playback, and so on).

    I hope you can find a solution along the lines you’ve suggested here (and I look forward to learning from it). Otherwise, you can do what I did, snatching semi-victory from the jaws of semi-defeat as follows:

    • Create a new landscape-only view controller exclusively for movie
      playing. It allows landscape orientation simply by answering
      shouldAutorotateToInterfaceOrientation:
    • Dig out all the ugly orientation code from the VC you’re working on,
      and simply presentModalViewController: on the new one. (You can even
      have a cool freebie transition effect, like a vertical slide in).
    • Load and play the movie when viewDidAppear
    • In the landscape video VC, subscribe to
      MPMoviePlayerPlaybackDidFinishNotification, on notify, do [self
      dismissModalViewController:YES];

    A side benefit of all this is that the movie player handling logic can get dumped in one place and easily reused in your app.

    Good luck. (I can provide detailed code if you need it).

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

Sidebar

Related Questions

Suppose I have requirement where I have Shape which contains area as only operation.
Applications which run on mobile devices have special user interface requirements. I think Apple
My requirement is to work on some interface .h files. Right now I have
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field
I have a rather strange requirement. I have property files in which same keys
I have a fairly simple requirement for a query API which I need to
I have an java interface which has few abstract methods. public interface Interface {
I have a requirement to build an 8 touchscreen interface on an instrument. I'm
I have a GUI project which I am about to start. GUI requirement is
I have created an interface using jQuery UI Tabs, however one of my requirements

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.