How to record video in iphone

Posted by Timmi on Stack Overflow See other posts from Stack Overflow or by Timmi
Published on 2010-03-31T04:48:49Z Indexed on 2010/03/31 4:53 UTC
Read the original article Hit count: 308

Filed under:

HI,

I need to record video using iPhone. To do that i used UIImagePickerController. I have an iPhone 3G, with me. when i run my code to check if source type available it says device not supported. My OS is 3.2.1, where i am wrong, can some one tell me what i need to change.

Also is there some other way to record video. What i need to do is to get the video stream as it is recorded.

    UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;

NSArray *sourceTypes = 
[UIImagePickerController availableMediaTypesForSourceType:picker.sourceType];
if (![sourceTypes containsObject:(NSString *)kUTTypeVideo ]){
    NSLog(@"device not supported");
    return;
}

//picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;    
picker.mediaTypes =  [NSArray arrayWithObject:(NSString *)kUTTypeVideo];    
picker.videoQuality = UIImagePickerControllerQualityTypeHigh;


[self presentModalViewController:picker animated:YES];

Thanks,

© Stack Overflow or respective owner

Related posts about iphone