Question

Hey looking for some help on this problem.

Currently I'm developing an iPhone application which is locked to portrait orientation throughout, however there are some videos included in the app using the MPMoviePlayer.

I want these videos (which automatically show in fullscreen) to be supported for both portrait and landscape orientations.

Any detailed ideas on how I could go about this? Literally tearing my hair out.

Many thanks!

Was it helpful?

Solution

  1. Remove the limitation from the plist.
  2. In each of your view controllers, implement -shouldAutorotateToInterfaceOrientation: to return YES only for supported interface orientations. You must return YES for at least one orientation (the normal portrait orientation in your case). Examples abound if you are unclear on how to do this.
  3. As @Till indicated, display your MPMoviePlayerController view using a view controller that supports all orientations in its -shouldAutorotateToInterfaceOrientation: (just return YES from the method).

But note that users tend to dislike apps that force an orientation, so make sure you have a very good usability case for why you need to impose this restriction. (The recommendation is you support all orientations except upside down on iPhone, so that the user doesn't try to, say, answer a call upside down.)

OTHER TIPS

Display the MPMoviePlayerController on the view of a modally presented UIViewController that allows all possible interface orientations. That way the rest of your app may remain as is (portrait only).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top