自定义iOS视频录制UI

时间:2016-11-20 13:15:59

标签: ios iphone swift xcode

如何使用自己的按钮实现自定义视频录制屏幕? 您可以在下面找到它的实施方式。

@IBAction func RecordAction(_ sender: AnyObject) {
    if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera) {
        print("Camera Available")
        let imagePicker = UIImagePickerController()
        imagePicker.delegate = self
        imagePicker.sourceType = .camera
        imagePicker.mediaTypes = [kUTTypeMovie as String]
        imagePicker.allowsEditing = false
        imagePicker.showsCameraControls = true
        self.present(imagePicker, animated:true, completion:nil)
    }
    else {
        print("Camera Unavailable")
    }

}

0 个答案:

没有答案