使用到的類:AVCaptureMovieFileOutput
0.使用session添加輸出
1.將AVCaptureMovieFileOutput對(duì)象寫(xiě)入到沙盒
代碼:
if session.canAddOutput(movieOutput) {
session.addOutput(movieOutput)
}
let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! + "/1.mp4"
let url = URL(fileURLWithPath: path)
movieOutput.startRecording(to: url, recordingDelegate: self)