How to record a video in iOS

前端 未结 4 1427
故里飘歌
故里飘歌 2020-12-29 17:19

Hi I would like to record a video in iPhone through Objective-C. Can someone provide me the sample code to write my own code. I have no idea how to do it. And i need it in h

4条回答
  •  生来不讨喜
    2020-12-29 18:08

    if ([UIImagePickerController
         isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        UIImagePickerController *picker = [[UIImagePickerController alloc] init];
        picker.modalTransitionStyle = UIModalPresentationFullScreen;
        picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        picker.showsCameraControls = YES;
        picker.delegate = self;
        picker.mediaTypes = @[(id)kUTTypeMovie];
        [self presentViewController:picker animated:YES  // self is a viewController
                         completion:^ {
                         }];
    }
    

提交回复
热议问题