Game Development Community

Play video on Iphone before starting engine?

by AltiMario · in iTorque 2D · 05/01/2010 (5:36 am) · 6 replies

I've used LUMA Resource to play video on Iphone... My question is...

There is a way to play short video before the engine start?

I tried to insert the code inside the S32 main(S32 argc, char *argv[]) method into iPhoneMain.mm but I receive EXC_BAD_ACCESS Error...


#1
05/01/2010 (2:03 pm)
If you want to play a video before the engine starts you would hook it up in the applicationDidFinish.... delegate method thats called upon the end of the PE loading, before you even call up the main etc
#2
05/01/2010 (4:04 pm)
Thanks Mark I've tried add the code below into applicationDidFinish I receive EXC_BAD_ACCESS Error:
Can you post me an example?

NSString *resourcePath = [[NSBundle mainBundle]pathForResource:@"introvideo" ofType:@"m4v"];
	 NSURL *link = [NSURL fileURLWithPath:resourcePath];
	 MPMoviePlayerController *movie = [[MPMoviePlayerController alloc] initWithContentURL:link];
	 
	 [movie setBackgroundColor:[UIColor blackColor]];
	 [movie setScalingMode:MPMovieScalingModeAspectFit];
	 [movie play];
#3
05/01/2010 (4:20 pm)
the error does not say anything.
you need to use the debugger and see where it is actually caused.
#5
05/01/2010 (5:44 pm)
Thats exactly what he didn't want to do, start the engine to do it :)

Quote:There is a way to play short video before the engine start?

#6
05/01/2010 (6:14 pm)
You'll be able to play video right after the initial loader image, and I'd say that is as close to engine start as possible :)

The latest version of the engine doesn't have a long delay to get to the first script - it's pretty much instant. I'd say it's better to do it the proper way.