MPMoviePlayerController ipad卡住加载

时间:2012-08-15 05:45:06

标签: ios ipad mpmovieplayercontroller

这是我试图在ipad上播放电影的代码 发生的事情是我只是在屏幕底部看到加载....

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish) 
         name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
NSString *movpath = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"mov"];
MPMoviePlayerViewController* mpviewController = [[MPMoviePlayerViewController alloc] 
          initWithContentURL:[NSURL fileURLWithPath:movpath]];
 mpviewController.view.userInteractionEnabled = YES;
 [self.view addSubview:mpviewController.view];
 MPMoviePlayerController *mp = [mpviewController moviePlayer];
 mp.controlStyle = MPMovieControlStyleDefault;
 [mp prepareToPlay];
 [mp play];

0 个答案:

没有答案