fileOutput(_:willFinishRecordingTo:from:error:)
Informs the delegate when the output will stop writing new samples to a file.
Declaration
optional func fileOutput(_ output: AVCaptureFileOutput, willFinishRecordingTo fileURL: URL, from connections: [AVCaptureConnection], error: (any Error)?)Parameters
- output:
The capture file output that will finish writing the file.
- fileURL:
The file URL of the file that is being written.
- connections:
An array of Avcaptureconnection objects attached to the file output that provided the data that is being written to the file.
- error:
An error describing what caused the file to stop recording, or
nilif there was no error.
Discussion
This method is called when the file output will stop recording new samples to the file at outputFileURL, either because startRecording(to:recordingDelegate:) or stopRecording() was called, or because an error (described by the error parameter) occurred (if no error occurred, the error parameter is nil).
This method is always called for each recording request, even if no data is successfully written to the file.
You should not assume that this method will be called on a specific thread, and should make this method as efficient as possible.