如何隐藏MPMoviePlayer控件?

时间:2009-11-02 10:34:24

标签: mpmovieplayer

我想在我的应用程序开始放一部电影,但我想隐藏电影控件,如(停止,播放,接下来......)这里是我的代码:

#import <MediaPlayer/MediaPlayer.h>



-(void)viewDidLoad
{
     NSBundle *bundle = [NSBundle mainBundle];
     NSString *moviePath = [bundle pathForResource:@"myvideo" ofType:@"mp4"];
     NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
     MPMoviePlayerController *IntroMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
     [IntroMovie play];
}

3 个答案:

答案 0 :(得分:3)

你可以IntroMovie.controlStyle = MPMovieControlStyleNone;

由于.movi​​eControlMode已被弃用。

答案 1 :(得分:2)

好的,我想通了。

代码:

IntroMovie.movieControlMode = MPMovieControlModeHidden;

答案 2 :(得分:0)

在Objective-C

moviePlayer.controlStyle = MPMovieControlStyleNone;

在Swift中

 moviePlayer.controlStyle = MPMovieControlStyle.None