MPMoviePlayerViewController上完成了动画吗?

时间:2012-12-27 13:22:42

标签: iphone ipad ios6 ios5.1 mpmovieplayer

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

MoviePlayer正在显示。但是点击“完成”按钮会解除一些不正常的行为。 理想情况下,电影播放器​​应该像正常的dismissMoviePlayerViewControllerAnimated一样消失,但我的控制看起来像现在的动画,我的控制器将覆盖电影播放器​​。

1 个答案:

答案 0 :(得分: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];