I am new to iPhone development and am writing my first app. The entire application needs only portrait mode, with the exception of video playback. I use MPMoviePlayerController to run the movie and it plays in protrait mode. How to get MPMoviePlayerController to play all movies in Landscape. I am using Xcode 4 and am creating for iOS 4.0+. Do I need to enter some settings in info.plist so that MPMoviePlayerController can play in the landscape?
Here is the code I'm using to initialize MPMoviePlayerController:
MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL: url]; [self.view addSubview:theMovie.view]; theMovie.allowsAirPlay=YES; [theMovie setFullscreen:YES animated:YES]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; [theMovie play];
source share