Play video in iPhone iOS 4 objective-c program code tutorial
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; NSString *movpath = [[NSBundle mainBundle] pathForResource:@"splash" ofType:@"mp4"]; MPMoviePlayerViewController* mpviewController = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:movpath]]; [window addSubview:mpviewController.view]; [window makeKeyAndVisible]; MPMoviePlayerController *mp = [mpviewController moviePlayer]; [mp prepareToPlay]; [[mpviewController moviePlayer] play];
Log in to answer.
Alex 3:07 am on June 23, 2010