add filePath to define recording directory

- add CaptureError.createRecordingDirectoryError
- stub RCTViewManager to be able to compile CameraViewManager
This commit is contained in:
Rui Rodrigues
2024-07-16 09:50:21 +01:00
parent 621bfe333c
commit 9f2c7906e5
10 changed files with 61 additions and 22 deletions

View File

@@ -11,7 +11,7 @@ import AVFoundation
// MARK: - CameraView + AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate
extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate {
func startRecording(options: NSDictionary, callback jsCallback: @escaping RCTResponseSenderBlock) {
func startRecording(options: NSDictionary, filePath: String, callback jsCallback: @escaping RCTResponseSenderBlock) {
// Type-safety
let callback = Callback(jsCallback)
@@ -21,6 +21,7 @@ extension CameraView: AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAud
// Start Recording with success and error callbacks
cameraSession.startRecording(
options: options,
filePath: filePath,
onVideoRecorded: { video in
callback.resolve(video.toJSValue())
},