我想使用以下代码隐藏 MPMoviePlayer 中的控件:
-(IBAction)video:(id)sender {
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"Intro" ofType:@"mov"];
NSURL *movie = [NSURL fileURLWithPath:moviePath];
MPMoviePlayerController *control = [[MPMoviePlayerController alloc]initWithContentURL:movie];
//[self.view addSubview: control.view];
control.scalingMode = MPMovieScalingModeFill;
control.controlStyle = MPMovieControlStyleNone;
control.shouldAutoplay = YES;
[control play];
MPMoviePlayerViewController *movieplayer = [[MPMoviePlayerViewController alloc]initWithContentURL:movie];
[self presentMoviePlayerViewControllerAnimated:movieplayer]; }
但这不起作用。
最佳答案
您正在重复代码。 MPMoviePlayerViewController 有 MPMoviePlayerController。因此将其用作 movieplayervc.moviePlayer.controlStyle = MPMovieControlStyleNone;
关于iphone - MPMoviePlayer 控制风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13121032/