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
This commit is contained in:
Marc Rousavy 2023-10-31 15:09:27 +01:00 committed by GitHub
parent 4c9a707866
commit cc65ec26a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,5 +26,23 @@ struct RecordVideoOptions {
} }
fileType = parsed 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
}
} }
} }