得到消息“警告:在正常情况下,_fillInQueueWithExtraSpace:..”和MPMoviePlayer旋转不工作在iPad IOS 5.1

这是我的第一篇文章,可能看起来不正确。 所以,我必须在iPad上使用cocos2d进行轮换(5.1)我在每个方向上使用2个不同的video。 在那里我有两个问题:

  1. 该应用程序以纵向模式开始,并正常播放video。 我打电话(播放)video5-10次,当video完成我旋转模拟器。 视图旋转,但当我打电话(播放)video – 它显示白色屏幕和下一个消息:

    “警告:在正常情况下,_fillInQueueWithExtraSpace:ignoreExistingItems:不应该被重新input。”

    然后,如果我再次旋转屏幕(多次) – 并以横向模式播放,则播放video效果很好。 反之亦然。 当我从风景模式开始

  2. 视图旋转的问题。 当我将视图旋转到左/右横向(从纵向) – 不能向后旋转视图。 所以我只能顺时针或逆时针旋转。 如何解决它?


-(id) init { pathToVideoP = [[NSBundle mainBundle] pathForResource:@"video_portrait" ofType:@"mp4"]; pathToVideoL = [[NSBundle mainBundle] pathForResource:@"video_landscape" ofType:@"mp4"]; theMovieP = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:pathToVideoP]]; theMovieL = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:pathToVideoL]]; } -(void) playVideoButtonClicked { movieButton.visible = FALSE; if (sharedManager.isPortrait){ theMovie = theMovieP; } else { theMovie = theMovieL; } [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:[theMovie moviePlayer]]; CGSize size = [[CCDirector sharedDirector] winSize]; [[[CCDirector sharedDirector] openGLView] addSubview:theMovie.view]; player = [self.theMovie moviePlayer]; player.controlStyle = MPMovieControlStyleNone; [theMovie moviePlayer].view.backgroundColor = [UIColor whiteColor]; theMovie.view.frame = CGRectMake(0, 0, size.width, size.height); if (sharedManager.isPortrait) { CGAffineTransform transform = player.view.transform; player.view.transform = transform; } else if (sharedManager.changeOrientation) { CGAffineTransform transform = player.view.transform; transform = CGAffineTransformRotate(transform, (-M_PI/2 )); player.view.transform = transform; } sharedManager.changeOrientation = NO; player.backgroundView.backgroundColor = [UIColor whiteColor]; theMovie.view.backgroundColor = [UIColor whiteColor]; player.view.userInteractionEnabled = NO; player.scalingMode = MPMovieScalingModeNone; [player play]; } -(void) moviePreloadDidFinish:(id)sender { } -(void) movieFinishedCallback:(NSNotification*) aNotification { theMovie = [aNotification object]; [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie]; [player stop]; [theMovie.view removeFromSuperview]; movieButton.visible = TRUE; } 

添加这行代码创buildPlayer对象后。 player = [self.theMovie moviePlayer]; player.controlStyle = MPMovieControlStyleNone;

在iOS 6.0以下版本中是必需的。 可能是有帮助的。

[player prepareToPlay];