如何隐藏 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];
}
i want put a movie at my application starting but i want hide the movie controls like (stop , play , next and ... ) here is my code :
#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];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以执行
IntroMovie.controlStyle = MPMovieControlStyleNone;
因为 .movieControlMode 已被弃用。
You could do
IntroMovie.controlStyle = MPMovieControlStyleNone;
Since .movieControlMode was deprecated.
好吧,我明白了。
代码:
Ok, i figured it out.
Code:
在 Objective-C 中
在 Swift 中
In Objective-C
In Swift