みなさん、こんにちは。
ビデオを再生する必要があるビューを撮影しました。ビデオは完全に再生されていますが、ビデオがビューに表示されないことはほとんどありません。そのとき、コンソールに次のような警告が表示されました
警告: 通常の状態では、_fillInQueueWithExtraSpace:ignoreExistingItems: を再入力しないでください。
誰かがこの問題を解決するのを手伝ってくれませんか
みんなありがとう
同じビューに2つのUIViewが表示されています。1つのビューで描画を開始すると、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);
}
}
私の問題は、ビデオが表示される場合と表示されない場合があることです。