3
(IM使用這跟cocos2d的)問題打MOV文件中的MPMoviePlayerController
這完全適用的MP4視頻
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"intro_iphone" ofType:@"mp4"]];
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, screenSize.width, screenSize.height);
[mpc setScalingMode:MPMovieScalingModeFill];
[mpc setControlStyle:MPMovieControlStyleNone];
[mpc setMovieSourceType:MPMovieSourceTypeFile];
[mpc setRepeatMode:MPMovieRepeatModeNone];
[[[CCDirector sharedDirector] openGLView] addSubview:mpc.view];
[mpc play];
但是,如果我嘗試將其更改爲.mov文件,沒有任何反應! ?沒有錯誤,所以它拿起文件,但沒有播放和沒有MPMoviePlayerPlaybackDidFinishNotification
。