I have a movie file that does work. I added a tableview controller inside a nav controller, inside a tab view controller, and when a user clicks on the table view cell I load the video view. It launches the movie (and rotates in the simulator), but the video doesn't play and the controls are for portrait view. I do hear sound and see time going by in the controls. So it's clearly just not landscape.
I tried some tricks to setOrientation, but they had warnings and didn't work properly.
Thanks for any help you can give.
#import "StreamViewController.h"
@implementation StreamViewController
@synthesize moviePlayer;
@synthesize streamURL;
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
- (void)viewDidAppear:(BOOL)animated {
NSBundle *bundle = [NSBundle mainBundle];
if (bundle)
{
NSString *moviePath = [bundle pathForResource:@"splash" ofType:@"m4v"];
self.streamURL = [NSURL fileURLWithPath:moviePath];
}
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self streamURL]];
moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
[moviePlayer play];
[super viewDidAppear:animated];
}
- (void)dealloc {
[super dealloc];
}
@end