如何使用自己的按钮实现自定义视频录制屏幕? 您可以在下面找到它的实施方式。
@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")
}
}