views:

116

answers:

1

Hi guys,

I try to record a video. The message I got is from the following code on the device:

    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
    imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePickerController.allowsEditing = YES;
    imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
    imagePickerController.delegate = self;
    [self presentModalViewController:imagePickerController animated:YES];
    [imagePickerController release];

Any ideas? I think it should be really easy to take a video. When I start the "Camera" app of the phone I have the choice between video and picture. Shouldn't it be available for my app also?

10x in advance, Danail

+1  A: 

The problem was the way I was trying to set the mode to video mode.

Instead of using this:

imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;

I changed it to this:

imagePickerController.mediaTypes =  
        [NSArray arrayWithObject:(NSString *)kUTTypeMovie];

and it worked.

Danail