所以我想在我的 iOS (cocos2d) 游戏中播放 .mov 文件格式的介绍场景。
这是我当前的代码。
CGSize winSize = [[CCDirector sharedDirector] winSize];
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"DD Logo" ofType:@"mov"]];
MPMoviePlayerController * mpc;
mpc = [[MPMoviePlayerController alloc] initWithContentURL:url];
[mpc setFullscreen:YES animated:NO];
mpc.shouldAutoplay = YES;
mpc.view.backgroundColor = [UIColor whiteColor];
mpc.view.frame = CGRectMake(0.0f, 0.0f, winSize.width, winSize.height);
[mpc setScalingMode:MPMovieScalingModeFill];
[mpc setControlStyle:MPMovieControlStyleNone];
[mpc setMovieSourceType:MPMovieSourceTypeFile];
[mpc setRepeatMode:MPMovieRepeatModeNone];
[[[CCDirector sharedDirector] openGLView] addSubview:mpc.view];
[mpc play];
发生的情况是,音频播放,但这就是屏幕的样子。 http://gyazo.com/4f046472666bf1f58c88128f24e66229