expo-camera 15.0.4 → 15.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,18 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 15.0.6 — 2024-05-10
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fix documention for `maxDuration` in `CameraRecordingOptions`. ([#28749](https://github.com/expo/expo/pull/28749) by [@alanjhughes](https://github.com/alanjhughes))
18
+
19
+ ## 15.0.5 — 2024-05-09
20
+
21
+ ### 🐛 Bug fixes
22
+
23
+ - On `iOS`, fix `ean13` barcodes not returning data. ([#28674](https://github.com/expo/expo/pull/28674) by [@alanjhughes](https://github.com/alanjhughes))
24
+
13
25
  ## 15.0.4 — 2024-05-07
14
26
 
15
27
  ### 🎉 New features
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '15.0.4'
4
+ version = '15.0.6'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.camera"
15
15
  defaultConfig {
16
16
  versionCode 32
17
- versionName "15.0.4"
17
+ versionName "15.0.6"
18
18
  }
19
19
  }
20
20
 
@@ -239,7 +239,7 @@ class ExpoCameraView(
239
239
  val file = FileSystemUtils.generateOutputFile(cacheDirectory, "Camera", ".mp4")
240
240
  val fileOutputOptions = FileOutputOptions.Builder(file)
241
241
  .setFileSizeLimit(options.maxFileSize.toLong())
242
- .setDurationLimitMillis(options.maxDuration.toLong())
242
+ .setDurationLimitMillis(options.maxDuration.toLong() * 1000)
243
243
  .build()
244
244
  recorder?.let {
245
245
  if (ActivityCompat.checkSelfPermission(context, Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
@@ -254,20 +254,23 @@ class ExpoCameraView(
254
254
  .start(ContextCompat.getMainExecutor(context)) { event ->
255
255
  when (event) {
256
256
  is VideoRecordEvent.Finalize -> {
257
- if (event.error > 0) {
258
- promise.reject(
257
+ when (event.error) {
258
+ VideoRecordEvent.Finalize.ERROR_FILE_SIZE_LIMIT_REACHED,
259
+ VideoRecordEvent.Finalize.ERROR_DURATION_LIMIT_REACHED,
260
+ VideoRecordEvent.Finalize.ERROR_NONE -> {
261
+ promise.resolve(
262
+ Bundle().apply {
263
+ putString("uri", event.outputResults.outputUri.toString())
264
+ }
265
+ )
266
+ }
267
+ else -> promise.reject(
259
268
  CameraExceptions.VideoRecordingFailed(
260
269
  event.cause?.message
261
- ?: "Video recording Failed: Unknown error"
270
+ ?: "Video recording Failed: ${event.cause?.message ?: "Unknown error"}"
262
271
  )
263
272
  )
264
- return@start
265
273
  }
266
- promise.resolve(
267
- Bundle().apply {
268
- putString("uri", event.outputResults.outputUri.toString())
269
- }
270
- )
271
274
  }
272
275
  }
273
276
  }
@@ -32,6 +32,7 @@ class BarcodeScannerUtils {
32
32
  static func avMetadataCodeObjectToDictionary(_ barcodeScannerResult: AVMetadataMachineReadableCodeObject) -> [String: Any] {
33
33
  var result = [String: Any]()
34
34
  result["type"] = barcodeScannerResult.type
35
+ result["data"] = barcodeScannerResult.stringValue
35
36
 
36
37
  // iOS converts upc_a to ean13 and appends a leading 0
37
38
  if barcodeScannerResult.type == AVMetadataObject.ObjectType.ean13 {
@@ -39,8 +40,6 @@ class BarcodeScannerUtils {
39
40
  if !value.isEmpty && value.hasPrefix("0") {
40
41
  result["data"] = value.dropFirst()
41
42
  }
42
- } else {
43
- result["data"] = barcodeScannerResult.stringValue
44
43
  }
45
44
 
46
45
  if !barcodeScannerResult.corners.isEmpty {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-camera",
3
- "version": "15.0.4",
3
+ "version": "15.0.6",
4
4
  "description": "A React component that renders a preview for the device's either front or back camera. Camera's parameters like zoom, auto focus, white balance and flash mode are adjustable. With expo-camera, one can also take photos and record videos that are saved to the app's cache. Morever, the component is also capable of detecting faces and bar codes appearing on the preview.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "1b95b402af6ec95f885aaf93eedfbfe521c548d9"
45
+ "gitHead": "e4b8d86442482c7316365a6b7ec1141eec73409d"
46
46
  }