I have one query regarding orientation and play video,
My application support portrait mode but when i start any video it will run only landscape mode then after when video have completed it automatically come portrait mode.
Below of the code I'm using
**MyMovieViewController.h**
#import <MediaPlayer/MediaPlayer.h>
@interface MyMovieViewController : MPMoviePlayerViewController
@end
**MyMovieViewController.m**
@implementation MyMovieViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
@end
But above of the code only working in iPhone 4.3 simulator and My application support 4.3 to 6.1.
So please can you help me out.