iphone - MPMoviePlayer 控制风格

标签 iphone objective-c mpmovieplayercontroller

我想使用以下代码隐藏 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.movi​​ePlayer.controlStyle = MPMovieControlStyleNone;

关于iphone - MPMoviePlayer 控制风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13121032/

相关文章:

iphone - 使用 NTimer 更新 NSDateFormatter

ios - UITextField 委托(delegate)跳转到 100% CPU 使用率并在使用键盘快捷键时崩溃

iphone - 将数组的属性提取到新数组中

iphone - 算法:在 NSDictionary 中保持键/值对的计数

ios - MPMoviePlayerViewController 在调试时工作正常,但在 iOS9 上发布时崩溃

ios - MPMoviePlayerController 运行错误

iphone - iOSscrollview.bounces 使应用程序在 iOS 4.x 上崩溃

ios - 删除 iphone 中的 "choose from gallary"选项?

objective-c - 就地重写 - stdout

ios - MPMoviePlayerController播放失败时如何获取错误描述