From cc65ec26a9ba68a9501fe14fc6f1b722368932e1 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Tue, 31 Oct 2023 15:09:27 +0100 Subject: [PATCH] fix: Fix Video `codec`, `bitRate` and `flash` being ignored on iOS (#2113) * fix: Fix VIdeo `codec`, `bitRate` and `flash` being ignored on iOS * Update RecordVideoOptions.swift --- package/ios/Types/RecordVideoOptions.swift | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/ios/Types/RecordVideoOptions.swift b/package/ios/Types/RecordVideoOptions.swift index 234758f..9bba5a3 100644 --- a/package/ios/Types/RecordVideoOptions.swift +++ b/package/ios/Types/RecordVideoOptions.swift @@ -26,5 +26,23 @@ struct RecordVideoOptions { } fileType = parsed } + // Flash + if let flashOption = dictionary["flash"] as? String { + guard let parsed = try? Torch(jsValue: flashOption) else { + throw CameraError.parameter(.invalid(unionName: "flash", receivedValue: flashOption)) + } + flash = parsed + } + // Codec + if let codecOption = dictionary["codec"] as? String { + guard let parsed = try? AVVideoCodecType(withString: codecOption) else { + throw CameraError.parameter(.invalid(unionName: "codec", receivedValue: codecOption)) + } + codec = parsed + } + // BitRate + if let parsed = dictionary["bitRate"] as? Double { + bitRate = parsed + } } }