如何在iphone中以肖像模式播放视频

问题描述:

我正在iphone/ipod中创建电影应用程序.i给它添加了一个视频。当我在模拟器中运行它时,它在肖像模式下正常运行。但是当我在ipod中运行我的应用程序时,它会打开一个空白视频并处于横向模式。但在模拟器中,当我点击播放我的视频时,直接播放纵向模式和iPod打开在横向模式下空白视频,我想在纵向模式下如何在iphone中以肖像模式播放视频

这是我的代码用于视频:

-(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 *moviePlayer =[[MPMoviePlayerViewController alloc]initWithContentURL:movieURL]; 
    [self presentMoviePlayerViewControllerAnimated:moviePlayer]; 
} 

请帮我解决这个问题。

+0

重复的问题:http://*.com/questions/1423610/how-to-play-movie-in-portrait-mode – 2010-09-30 16:16:11

+0

另一个重复的问题:http://*.com/questions/1967932/can-我在播放视频在肖像模式 – 2010-09-30 16:16:59

你的iPod运行的是哪个版本的iOS?版本3.x将始终以横向模式打开视频,版本4.x将以当前方向打开视频。

+0

我的iPod是4.0版本,但它也是在横向模式下打开 – Pradeep 2010-09-30 10:36:46

+0

请simon帮我解决这个问题 – Pradeep 2010-09-30 10:40:25

+0

谢谢你的回答 – Pradeep 2010-10-02 06:14:40