self.moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:pathToFile]];
[self presentMoviePlayerViewControllerAnimated:self.moviePlayerViewController];
MoviePlayer正在显示。但是点击“完成”按钮会解除一些不正常的行为。
理想情况下,电影播放器应该像正常的dismissMoviePlayerViewControllerAnimated
一样消失,但我的控制看起来像现在的动画,我的控制器将覆盖电影播放器。
答案 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];