Using a URL to display a movie
I am using a custom camera overlay to capture a video. I am trying to
display the video the user took in another view, but it is not working. I
am using this code to get the URL
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
self.movieURL = info[UIImagePickerControllerMediaURL];
NSLog(@"Createing testing");
[picker dismissViewControllerAnimated:YES completion:NULL];}
And this to display it
self.movieController = [[MPMoviePlayerController alloc] init];
[self.movieController setContentURL:self.movieURL];
[self.movieController.view setFrame:CGRectMake ( 0, 0, 320, 568)];
[self.view addSubview:self.movieController.view];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:self.movieController];
[self.movieController play];
No comments:
Post a Comment