I am using the following code to allow users to record video using their iPhone camera, and then upload it directly to my server. I would like to put a limit on the length of the video they can record (5 seconds in this example) and it looks like using videoMaximumDuration would be the obvious way of doing that, but it has no effect.
Does anyone have any ideas?
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:imagePicker animated:YES];
imagePicker.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:imagePicker.sourceType];
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
[imagePicker setVideoMaximumDuration:5];
[imagePicker release];
I've tried it with allowsEditing as YES and NO, but it made no difference.
Thanks,
Steven
I'm sorry, but I just solved it ... I'm such a dunce. Moving the presentModalViewController to the end did the trick. I can't believe I didn't notice that!
Thanks guys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With