大家好 古德晚会
我已经查看了我必须播放视频的视图,视频正在完美播放,但很少有视频没有出现在视图上,当时我在控制台中收到警告,例如
警告:在正常情况下,_fillInQueueWithExtraSpace:ignoreExistingItems: 不应重新输入。
有人可以帮我解决这个问题吗
谢谢大家
我有 2 个 UIView 显示在同一个视图上,在一个视图中,当我开始绘制时,movieplayer 在 bottomProgressView 中启动,在 viewdidload 的 viewcontroller 中,代码是这样的
- (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);
}
}
我的问题是视频有时会出现有时不出现,