在应用中播放视频而不是默认播放器

时间:2015-01-05 05:14:48

标签: ios mpmovieplayercontroller movie video-player

我使用以下代码播放视频:

MPMoviePlayerViewController *theMovie=
    [[MPMoviePlayerViewController alloc] initWithContentURL: movieURL];
    theMovie.moviePlayer.repeatMode=MPMovieRepeatModeOne;

[self presentMoviePlayerViewControllerAnimated:theMovie];

这会导致默认电影播放器​​覆盖该应用。相反,我希望视频在应用程序内部播放如下:

这可以实现吗?

2 个答案:

答案 0 :(得分:0)

您可以像这样设置框架:

theMovie.view.frame = CGRectMake(10, 10, 300, 300);

然后在没有呈现的情况下将其添加为子视图:

[self.view addSubview: theMovie.view];

希望这会有所帮助.. :)

答案 1 :(得分:0)

相关问题