2
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {

    NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];


    //get the videoURL 
    NSString *tempFilePath = [videoURL path];


    if ( UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(tempFilePath))
    {
      // Copy it to the camera roll.
      UISaveVideoAtPathToSavedPhotosAlbum(tempFilePath, self, @selector(video:didFinishSavingWithError:contextInfo:), tempFilePath);
    } 



    //NSURL *movieUrl = [NSURL fileURLWithPath:filePath];
    _videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
    _videoPlayer.view.frame = CGRectMake(kMarginWidth, kMarginWidth, kMPlayerWidth, kMPlayerHeight);

    // Here is where you set the control Style like fullscreen or embedded
    _videoPlayer.controlStyle = MPMovieControlStyleDefault;
    _videoPlayer.scalingMode = MPMovieScalingModeAspectFit;
    _videoPlayer.contentURL = videoURL; 

     self addSubview:_videoPlayer];

}

but videoPlayer does not woks, the only shows "loading movie" on the screen for seconds.

so could some 1 tell me how to play the saved video? or how to retrieve the path of saved video in album?

Cœur
  • 37,241
  • 25
  • 195
  • 267
lingzhao
  • 117
  • 2
  • 7
  • I saw your similar question in other stackoverflow link.. Use the following code to play the video and check.. Hope this will be useful.. http://stackoverflow.com/questions/2978405/writing-an-app-to-stream-video-to-iphone/8937518#8937518 – Dilip Rajkumar Jun 09 '12 at 15:35
  • I finally find the problem, it is caused by the animation. – lingzhao Jun 11 '12 at 05:42
  • 1
    ohh still MPMoviePlayerController will consume more memory.. Please check it. You can post you solution to the problem as a answer so that it will help some one in future.. thanks.. – Dilip Rajkumar Jun 11 '12 at 06:27

0 Answers0