开发者

Problem playing mov file in MPMoviePlayerController

(Im using this with Cocos2d)

This works perfectly for an mp4 video

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];

But if I try and change it to a .mov file, nothing happens!? There is no error, so its picking up the file, but th开发者_JS百科eres no play back and no MPMoviePlayerPlaybackDidFinishNotification.


Problem was the codec the .mov was created with, was not iPhone compatible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜