Hey there everyone, I'm trying to put a splashvideo instead of a boring splashscreen in my project, I've been looking on the entire web without find anything but I feel close to solution.
with this code in the app delegate i can hear the sound of my video but i can't see it even if i said to the program to show me the window when the movie is over.
could anyone help me?
P.S. sorry for my bad english
Code:
@implementation SplashVideo_1AppDelegate
@synthesize window=_window;
MPMoviePlayerController *player;
- (void)dealloc
{
[_window release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Splashvideo" ofType:@"m4v"];
MPMoviePlayerController *player =[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:filePath]];
player.fullscreen=YES;
[player prepareToPlay];
player.controlStyle=MPMovieControlStyleNone;
[[player view] setFrame:_window.bounds];
[self.window addSubview:[player view]];
[player play];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish) name:MPMoviePlayerPlaybackDidFinishNotification object:player];
return YES;
}
-(void) moviePlayBackDidFinish {
[player.view removeFromSuperview];
[player release ];
[_window makeKeyAndVisible];
}
could anyone help me?
P.S. sorry for my bad english