如何使用UIImagePickerController类仅允许iPhone 3GS的录像机显示

如何使用UIImagePickerController类仅允许iPhone 3GS的录像机显示,iphone,iphone-sdk-3.0,uiimagepickercontroller,video-capture,iphone-3gs,Iphone,Iphone Sdk 3.0,Uiimagepickercontroller,Video Capture,Iphone 3gs,使用UIImagePicker类,我可以选择UIImagePickerControllerSource作为UIImagePickerControllerSourceTypeCamera。这将显示两个选项,摄像头和视频录像机 我只希望用户可以使用视频录制选项。一旦用户打开它就开始录制,而无需点击录制按钮 有谁知道这是怎么可能的 谢谢在UIImagePickerController上设置属性。在.h文件中 #define MAX_VIDEO_DURATION 10 @interface VideoC

使用UIImagePicker类,我可以选择UIImagePickerControllerSource作为UIImagePickerControllerSourceTypeCamera。这将显示两个选项,摄像头和视频录像机

我只希望用户可以使用视频录制选项。一旦用户打开它就开始录制,而无需点击录制按钮

有谁知道这是怎么可能的

谢谢

在UIImagePickerController上设置属性。

在.h文件中

#define MAX_VIDEO_DURATION 10
@interface VideoCaptureVC_iPhone : UIViewController
<UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate>
{
    IBOutlet UIImageView *imageView;
    UIImagePickerController *picker;
}

是-将媒体类型设置为kUTTypeMedia后,该操作成功。但这个问题仍然没有得到100%的回答。我怎样才能在录音机打开时自动录音。不希望用户点击录制按钮。啊。没办法,我很确定。大卫-谢谢你的跟进!这只是一个超级疯狂的想法——是否有可能以编程方式在特定的(x,y)点触摸事件?所以基本上你想模拟鼠标点击记录按钮?我不知道,但我认为我还没有看到任何应用程序能做到这一点,所以这可能是不可能的,也可能是不允许的。
- (void)viewDidLoad
{
 // Create UIImagePickerController
    picker = [[UIImagePickerController alloc] init];
    picker.videoQuality = UIImagePickerControllerQualityTypeMedium;
    picker.mediaTypes = [NSArray arrayWithObject:(NSString*)kUTTypeMovie];
    picker.videoMaximumDuration = MAX_VIDEO_DURATION;

    // Set the source type to the camera
    [picker setSourceType:UIImagePickerControllerSourceTypeCamera];

    // Set ourself as delegate
    [picker setDelegate:self];

    // Always check to see if there is a front facing camera before forcing one on the picker
    if([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]){
        [picker setCameraDevice:UIImagePickerControllerCameraDeviceFront];
    }
    [picker setShowsCameraControls:NO];
[picker takePicture]
}