Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Before you can record video, you must detect whether the device supports camera-based video recording. Checking for an onboard camera, such as those in the first generation and 3G iPhones, is not sufficient. Only the 3GS and newer units provide video recording capabilities. Perform two checks: first, that a camera is available, and second, that the available capture types includes video. The following method performs those checks.
- (BOOL) videoRecordingAvailable
{
// The source type must be available
if (![UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypeCamera])
return NO;
// And the media type must include the movie type
NSArray *mediaTypes = [UIImagePickerController
availableMediaTypesForSourceType:
UIImagePickerControllerSourceTypeCamera]
return [mediaTypes containsObject:@"public.movie"];
}