Search code examples
iphonevideoasihttprequestvideo-capture

Capture a video of 10 seconds length and upload it to server using ASIHTTPRequest


I need to capture a video which will be maximum length of 10 seconds, and also need to upload it to server using ASIHttpRequest,

how do I do that?


Solution

  • You can set the videoMaximumDuration property of image picker for this.

    UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
        imagePicker.delegate = self;
        imagePicker.mediaTypes  = @[(NSString *)kUTTypeMovie];
        imagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
    
    
        imagePicker.videoMaximumDuration = 10;