All pastes #2049560 Raw Edit

Mine

public text v1 · immutable
#2049560 ·published 2011-04-23 02:11 UTC
rendered paste body
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:theURL];
		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer];
		
		moviePlayer.view.frame = self.view.frame;
		[self.view addSubview:moviePlayer.view];
		[moviePlayer setFullscreen:YES animated:YES];
		
		
		[moviePlayer play];


- (void)moviePlayBackDidFinish: (NSNotification *)aNotification
{
	MPMoviePlayerController *theMovie = [aNotification object];
	
	[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
	[theMovie.view removeFromSuperview];
	[theMovie release];
	NSLog(@"MOVIE STOPPED");
}