I'm going crazy with it!
I have a app that uses cocos2d 0.99.4 and the last Xcode3.2.3
Base SDK is set to 4.0 and target 3.0 with iphone/ipad
I want to reproduce a full screen video with no controls and my own overlay ccbutton to skip it. should be easy right?
The main problem is that the API's for 3.2 of higher is totally different than 3.0 and i don't know how to proced to have only one code.
This is my code
if ([MPMoviePlayerController respondsToSelector:@selector(setBackgroundView:)]) {
MPMoviePlayerViewController *mpv= [[MPMoviePlayerViewController alloc] initWithContentURL:
[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"intro1" ofType:@"m4v"]]];
mpv.view.backgroundColor = [UIColor blackColor];
mpv.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[[[mpv moviePlayer] backgroundView] setBackgroundColor:[UIColor blackColor]];
[[[CCDirector sharedDirector] openGLView] addSubview:mpv.view];
[[mpv moviePlayer] play];
}
else {
MPMoviePlayerController *mp=
mp = [[MPMoviePlayerController alloc] initWithContentURL:
[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"intro1" ofType:@"m4v"]]];
mp.backgroundColor = [UIColor blackColor];
[mp setControlStyle:MPMovieControlStyleFullscreen];
[mp setMovieControlMode:MPMovieControlModeHidden];
[mp play];
}