【发布时间】:2015-06-08 07:05:40
【问题描述】:
我正在尝试创建一个如下图所示的播放器,从播放和暂停按钮开始。但它没有出现在播放器上。如何为我的播放器、自定义栏、音量栏等创建自定义面板?
- (IBAction)playMovie:(UIButton *)sender {
NSURL *url = [[NSURL alloc] initWithString:urlStr.text];
self.movie = [[MPMoviePlayerController alloc]initWithContentURL:url];
self.movie.controlStyle = MPMovieControlStyleNone;
self.movie.shouldAutoplay = YES;
[self.view addSubview:self.movie.view];
[self.movie setFullscreen:YES animated:YES];
playButton = [[UIButton alloc] initWithFrame:CGRectMake(100, 200, 100, 100)];
[playButton setImage:[UIImage imageNamed:@"apple.png"] forState:UIControlStateNormal];
[playButton addTarget:self action:@selector(playButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:playButton];
}
【问题讨论】:
标签: ios objective-c video-streaming custom-controls mpmovieplayercontroller