因此,我試圖在我的iOS(cocos2d)遊戲中以.mov文件格式播放介紹場景。在iOS中播放.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
試試這個主題,它解決了你的問題? http://stackoverflow.com/questions/3019200/how-to-rotate-an-mpmovieplayercontroller – DogCoffee
有一半的工作,它仍然只顯示默認的QuickTime的標誌,但沒有固定的旋轉感謝 – tyler53