大家好晚会
我已经看过我必须播放视频,视频正在播放完美,但很少我视频没有出现在视图上,当时我在控制台中收到警告,如< / p>
警告:在正常情况下,_fillInQueueWithExtraSpace:ignoreExistingItems:不应重新输入。
有人可以帮我解决这个问题
谢谢大家
我在同一个视图中显示2个UIView,在一个视图中,当我开始绘制movieplayer时,在bottomProgressView中启动,在viewdtroller中的viewdtroller中,代码就像这样
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *url = [[NSBundle mainBundle] pathForResource:@"progres" ofType:@"mp4"];
timeCompletedCnlr = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:url]] ;
[timeCompletedCnlr.view setFrame:CGRectMake(0,468, 600, 50)];
[timeCompletedCnlr setControlStyle:MPMovieControlStyleNone];
[bottomProgressView addSubview:timeCompletedCnlr.view];
}
当我触摸要绘制的视图时,将调用以下方法。
- (void)removeGivenWord
{
[bottomToolBar removeFromSuperview];
[self.view addSubview:bottomProgressView];
[timeCompletedCnlr play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(helpVideoFinished:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:timeCompletedCnlr];
UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
doneBtn.frame = CGRectMake(601, 940, 167, 43);
[doneBtn setBackgroundImage:[UIImage imageNamed:@"done.png"] forState:UIControlStateNormal];
[doneBtn addTarget:self action:@selector(doneButtonClicked) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:doneBtn];
}
放置视频的视图也包含完成按钮..
- (void)doneButtonClicked {
[timeCompletedCnlr stop];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(helpVideoFinished:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:timeCompletedCnlr];
}
- (void) helpVideoFinished:(NSNotification*) aNotification {
MPMoviePlayerController *player1 = [aNotification object];
[[NSNotificationCenter defaultCenter]removeObserver:self
name:MPMoviePlayerPlaybackDidFinishNotification
object:player1];
[smoothLineView completed5Sec];
NSLog(@"5sec called");
NSError *error = [[aNotification userInfo] objectForKey:@"error"];
if (error) {
NSLog(@"Did finish with error: %@", error);
}
}
我的问题是视频有时出现,有时它不会出现,