2

I want to trim video so i am using UIVideoEditorController but when i check can edit file then it return false for all the files, mp4,mov,m4v. So any one will please guide me what is the problem.

  1. Will you please give me the link of any tutorial of using UIVIdeoEditorcontroller
danh
  • 62,181
  • 10
  • 95
  • 136
time
  • 65
  • 1
  • 6

2 Answers2

11

UIVideoEditorController does not work on simulator so it always returns false, it will work fine on device.

SreeHarsha
  • 496
  • 4
  • 19
1

You can find editing of video by path through UIVideoEditorController.

UIVideoEditorController* videoEditor = [[UIVideoEditorController alloc] init];
videoEditor.delegate=self;

NSString* videoPath = [[NSBundle mainBundle] pathForResource:@"video" ofType:@"MOV"];
if ( [UIVideoEditorController canEditVideoAtPath:videoPath] )
{
    videoEditor.videoPath = videoPath;
    videoEditor.videoMaximumDuration = 10.0;

    //[self.customAvPlayerView addSubview:videoEditor.view];

    [self presentViewController:videoEditor animated:YES completion:nil];
} 
else
{
    NSLog( @"can't edit video at %@", videoPath );
}

http://www.raywenderlich.com/forums/viewtopic.php?t=11571&p=60182

Jesse Bunch
  • 6,651
  • 4
  • 36
  • 59