1
self.moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:pathToFile]];
[self presentMoviePlayerViewControllerAnimated:self.moviePlayerViewController];

MoviePlayer 正在显示。但是单击完成按钮它会以一些奇怪的行为消失。理想情况下,电影播放器​​应该像正常一样关闭,dismissMoviePlayerViewControllerAnimated但我的控件看起来像现在的动画,我的控制器将覆盖电影播放器​​。

4

1 回答 1

0

尝试如下并检查这是否适合您:

moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL];
[moviePlayerController.moviePlayer prepareToPlay];
moviePlayerController.moviePlayer.shouldAutoplay=YES;
moviePlayerController.view.frame = self.view.frame;
[self presentMoviePlayerViewControllerAnimated:moviePlayerController];
[moviePlayerController.moviePlayer play];
于 2012-12-28T02:49:36.463 回答