1.http://www.cnblogs.com/KidReborn/archive/2010/10/07/1845097.html
-(void)openMovie:(id)sender{NSString *path = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"m4v"];MPMoviePlayerController *movieController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]]; //設定要播放的視頻的位置[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:movieController]; //設定視頻播放結束後的回調處理[movieController play]; //播放視頻}
-(void)movieFinish:(NSNotification*)notification{MPMoviePlayerController *movieController = [notification object];[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:movieController];[movieController release]; //釋放資源movieController = nil;[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];}
下載:demo