swift 3 record video but not audio

1.5k views Asked by At

I am setting up a camera controller with the following in swift 3:

let cameraController = UIImagePickerController()
    cameraController.sourceType = .camera
    cameraController.mediaTypes = [kUTTypeMovie as NSString as String]
    cameraController.showsCameraControls = true
    cameraController.videoQuality = UIImagePickerControllerQualityType.typeHigh
    cameraController.allowsEditing = false
    cameraController.delegate = delegate
    present(cameraController, animated: false, completion: nil)

This records both video and audio, and so asks for access to the camera and the microphone. The audio is not at all useful here.

How do you record video, but disable to microphone so that no audio is recorded, and so that permission to use the microphone is not asked?

1

There are 1 answers

3
nwales On

Setting your media type to KUTTypeVideo instead of KUTTypeMovie should do the trick.

KUTTypeVideo documentation