How to play video in portrait mode in iphone
I am creating a movie appliction in iphone/ipod .i have added a video to it . when i run it in simulator it runs properly in portrait mode.But when i run my app in ipod it opens a blank video and in landscape mode .but in simulator when i click on play my video directly plays in portrait mode and in ipod it opens a blank video in landscape mode which i want in portrait mode
This is my code for video:
-(IBAction)video1:(id)sender
{
NSBundle *bundle =[NSBundle mainBundle];
NSString *moviepath =[bundle pathForResource:@"CRY CRY - 90 Sec Video" ofType:@"mov"];
NSURL *movieURL =[[NSURL fileURLWithPath:moviepath]retain];
MPMoviePlayerController *theMovie =[[MPMoviePlayerController alloc]initWithContentURL:movieURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
[theMovie play];
MPMoviePlayerViewController *moviePl开发者_运维知识库ayer =[[MPMoviePlayerViewController alloc]initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
}
Please help me in solving this problem.
What version of iOS is your iPod running? Version 3.x will always open videos in landscape mode, version 4.x will open videos in the current orientation.
精彩评论