2

这是我试图运行以在 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];
4

0 回答 0