3

我有 MPMoviePlayerController,我想以编程方式显示控件,比如在用户点击之后,或者模拟用户点击。

http://i.stack.imgur.com/KYMmG.jpg (对不起,我没有足够的声誉,无法发布图片)。

我怎样才能做到这一点?谢谢。

4

2 回答 2

6

以下列方式创建 MPMoviePlayerController 对象将为您提供视频控件的界面

yourMoviePlayerController = [MPMoviePlayerController new];     
yourMoviePlayerController.controlStyle=MPMovieControlStyleEmbedded;
[yourMoviePlayerController setContentURL:[NSURL fileURLWithPath:videoPath]];
yourMoviePlayerController.backgroundView.hidden = YES;

[yourMoviePlayerController setScalingMode:MPMovieScalingModeAspectFit];
yourMoviePlayerController.shouldAutoplay=YES;
yourMoviePlayerController.movieSourceType = MPMovieSourceTypeFile;
于 2012-08-23T08:11:49.760 回答
1

我想有人已经在这里回答了这个问题

controlStyle属性设置为MPMovieControlStyleNone最初,然后MPMovieControlStyleFullscreen使用[performSelector:withObject:afterDelay:1]. 它运作良好,在用户点击视频之前不会出现控件。

于 2012-08-23T08:12:54.420 回答