Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)playMovie
- {
- NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"CHLOE_T2T_010713_MODIFIER_V2" ofType:@"mp4"]];
- self.moviePlayer = [[MPMoviePlayerController alloc]
- initWithContentURL:url];
- [[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(moviePlayBackDidFinish:)
- name:MPMoviePlayerPlaybackDidFinishNotification
- object:self.moviePlayer];
- self.moviePlayer.controlStyle = MPMovieControlStyleDefault;
- self.moviePlayer.shouldAutoplay = YES;
- [self.view addSubview:self.moviePlayer.view];
- [self.moviePlayer setFullscreen:YES animated:YES];
- }
- - (void) moviePlayBackDidFinish:(NSNotification*)notification {
- NSLog(@"fin video");
- MPMoviePlayerController *player = [notification object];
- [[NSNotificationCenter defaultCenter]
- removeObserver:self
- name:MPMoviePlayerPlaybackDidFinishNotification
- object:player];
- if ([player
- respondsToSelector:@selector(setFullscreen:animated:)])
- {
- [player.view removeFromSuperview];
- }
- //self.viewDeckController.rotationEnabled = YES;
- UIViewController *controller = [[UIViewController alloc] init];
- [self.viewDeckController.navigationController presentViewController:controller animated:NO completion:nil];
- [controller release];
- }
Add Comment
Please, Sign In to add comment