我想用下面的代码对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]; }但这并不管用。
发布于 2012-10-30 21:10:47
你在重复代码。MPMoviePlayerViewController有MPMoviePlayerController。所以使用它作为movieplayervc.moviePlayer.controlStyle = MPMovieControlStyleNone;
发布于 2012-10-29 19:54:52
你试过这个[videoPlayerobj setControlStyle:MPMovieControlStyleNone];吗?
发布于 2013-12-06 02:15:13
我的播放器设置在viewDidLoad中,这一行隐藏了MPMoviePlayerController。我已经将我的MPMoviePlayer控制器初始化为*stream。
stream.view.hidden = YES;希望这能有所帮助!
https://stackoverflow.com/questions/13121032
复制相似问题