(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 theres no play back and no MPMoviePlayerPlaybackDidFinishNotification.
Problem was the codec the .mov was created with, was not iPhone compatible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With