2013-02-19 86 views
0

在我的應用程序中,我通過MpMovie Player錄製了一個視頻&。它似乎工作正常。iPhone中的MoviePlayer導航欄框架問題SDK

但是,當我播放視頻時,導航欄(默認進度條)下降,而不是加入狀態欄。

See Navigation bar

我的代碼,以播放視頻是遵循

-(IBAction)mth_play:(id)sender 
{ 
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES); 

    NSString *VidLibrary = [paths objectAtIndex:0]; 


    NSString *url = [VidLibrary stringByAppendingPathComponent:@"p.mp4"]; 

    MPMoviePlayerViewController *pv=[[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL fileURLWithPath:url]]; 

    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(playfinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:[pv moviePlayer]]; 
    MPMoviePlayerController *pc=[pv moviePlayer]; 

    [self.view addSubview:pv.view]; 
    [pc play]; 
} 

如何解決這個問題?

回答

1

有,爲什麼你添加任何特別原因MPMoviePlayerViewControllerview作爲一個子視圖?

您可以顯示MPMoviePlayerViewController模態改爲:

[self presentViewController:pv animated:YES completion:nil]; // iOS 5+ 

[self presentModalViewController:pv animated:YES]; // technically deprecated in iOS 6 
+0

非常感謝! – user1673099 2013-02-19 09:12:18

0
  1. 隱藏導航欄。
  2. 設置pv幀0,0