2010-09-30 54 views
0

我正在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://stackoverflow.com/questions/1423610/how-to-play-movie-in-portrait-mode – 2010-09-30 16:16:11

+0

另一個重複的問題:http://stackoverflow.com/questions/1967932/can-我在播放視頻在肖像模式 – 2010-09-30 16:16:59

回答

0

你的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

相關問題