I want to make an app that plays a video fullscreen on startup, without video controls or any response to touch. I've managed to mooch the necessary code off of iphonedevsdk forums, but nobody there would help me build it. I will use the XCode hack to build it without paying the $99. Here's the code:
- (IBAction) videoAction:(id)sender
{
if (myMovie)
return ;
NSString* a_path = [[NSBundle mainBundle] pathForResource:@"kevin-kell-introduction" ofType: @"mp4"];
if (a_path==nil)
return ;
NSURL* a_url = [NSURL fileURLWithPath:a_path];
if (a_url==nil)
return ;
Class moviePlayerViewControllerClass = (NSClassFromString(@"MPMoviePlayerViewController"));
newStyleVideoPlayer = moviePlayerViewControllerClass && [MPMoviePlayerViewController instancesRespondToSelector: @selector(presentMoviePlayerViewControllerAnimated:)];
if (newStyleVideoPlayer)
{
//We're running in iOS 3.2 or later, so use the new MPMoviePlayerViewController class.
MPMoviePlayerViewController* movie_controller = [[[MPMoviePlayerViewController alloc] initWithContentURL:a_url] autorelease];
if (movie_controller) {
self.myMovie = movie_controller;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playBackFinished:) name:@"MPMoviePlayerPlaybackDidFinishNotification" object:nil];
MPMoviePlayerController* theMoviewPlayer = movie_controller.moviePlayer;
theMoviewPlayer.controlStyle = MPMovieControlStyleNone;
//theMoviewPlayer.fullscreen = TRUE;
[[UIApplication sharedApplication] setStatusBarHidden: TRUE withAnimation: UIStatusBarAnimationNone];
[self presentMoviePlayerViewControllerAnimated: (MPMoviePlayerViewController*)self.myMovie];
}
}
}
Could anyone help me with this, or do it for me?
Page 1 of 1
I need help coding this app I already have all the code needed
Share this topic:
Page 1 of 1

Sign In »
Register Now!
Help
Back to top










