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

回答

3

问题是.MOV与创建的编解码器,是不是iPhone兼容。