简体   繁体   中英

How to limit video crop section for 10 seconds in iOS?

在此处输入图片说明

I want to set the cropping section set to 10 seconds time. Is it possible to do with default image picker. Is it is how may I do it?

Check these links

1] FSMediaPicker

2] FunCrop

3] InstagramAssetsPicker

Hope it helps.

Third worked for me*.

Try This code..

-(void)recordVideo{
    imagePicker = [[UIImagePickerController alloc]init];
    imagePicker.delegate = self;
    imagePicker.allowsEditing = YES;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.mediaTypes = [[NSArray alloc]initWithObjects:(NSString *) kUTTypeMovie, (NSString *) kUTTypeMPEG4, nil];
    imagePicker.videoQuality = UIImagePickerControllerQualityTypeIFrame1280x720;
    [imagePicker setVideoMaximumDuration:10.0f];
    sourceType = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
    if (![sourceType containsObject:(NSString *) kUTTypeMovie]) {
        NSLog(@"Can not Save Video");
    }
    [self presentModalViewController:imagePicker animated:YES];
}

Make sure that, you have to set allowsEditing to YES before presenting the controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM