Nithin M Keloth
Nithin M Keloth

Reputation: 99

UIImagepicker display Image capturing instead of Video recording

I am using UIImagepickerController to capture video in my app. Sometimes it behaves strangely - that image capturing is coming. Mostly it comes when a new user is registered and try to capture a video or a new ipa file is installed and tested. Eventhough it appears randomly.

When I prompt UIImagepickerController it display take photo button (White button) instead of video record button (Red button)

Here is my code -

 UIImagePickerController *imagePicker=[[UIImagePickerController alloc]init];
 imagePicker.delegate=self;
 if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
   {
    imagePicker.allowsEditing = YES;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
    imagePicker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
  }
[self presentViewController:imagePicker animated:YES completion:NULL];

Upvotes: 0

Views: 490

Answers (1)

vivekDas
vivekDas

Reputation: 1288

Just try replacing your code with this.

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    picker.allowsEditing = YES;
   // picker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMoviekUTTypeImage];
    picker.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeMovie,nil];
    //picker.cameraCaptureMode = UIImagePickerControllerCameraCaptureModeVideo;
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;

    [self presentViewController:picker animated:YES completion:NULL];

Upvotes: 1

Related Questions