expo-camera 14.0.5 → 14.1.0
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 +20 -0
- package/android/build.gradle +2 -2
- package/build/next/Camera.types.d.ts +1 -0
- package/build/next/Camera.types.d.ts.map +1 -1
- package/build/next/Camera.types.js.map +1 -1
- package/build/next/utils/props.d.ts.map +1 -1
- package/build/next/utils/props.js +2 -0
- package/build/next/utils/props.js.map +1 -1
- package/ios/CameraView.swift +5 -9
- package/ios/ExpoCameraUtils.swift +2 -2
- package/ios/Next/CameraViewNext.swift +25 -41
- package/ios/Next/ExpoCameraUtilsNext.swift +21 -0
- package/package.json +2 -2
- package/src/next/Camera.types.ts +1 -0
- package/src/next/utils/props.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 14.1.0 — 2024-03-13
|
|
14
|
+
|
|
15
|
+
### 🐛 Bug fixes
|
|
16
|
+
|
|
17
|
+
- On `Android`, fix empty qualities being passed to QualitySelector ([#27126](https://github.com/expo/expo/pull/27126) by [@leonhh](https://github.com/leonhh))
|
|
18
|
+
- On `web`, prevent creating a webworker when rendering on the server ([#27222](https://github.com/expo/expo/pull/27222) by [@marklawlor](https://github.com/marklawlor))
|
|
19
|
+
- On `iOS`, fix method call on an optional variable. ([#27235](https://github.com/expo/expo/pull/27235) by [@alanjhughes](https://github.com/alanjhughes))
|
|
20
|
+
- On `iOS`, fix the orientation value in `onResponsiveOrientationChanged` when `exif` is set to true. ([#27314](https://github.com/expo/expo/pull/27314) by [@alanjhughes](https://github.com/alanjhughes))
|
|
21
|
+
- Fix scanned frame bounds when scanning a barcode. ([#27207](https://github.com/expo/expo/pull/27207) by [@tamagokun](https://github.com/tamagokun))
|
|
22
|
+
- Fix incorrect prop name `flash` being passed to native. ([#27394](https://github.com/expo/expo/pull/27394) by [@alanjhughes](https://github.com/alanjhughes))
|
|
23
|
+
- Ensure `mute` prop is passed to native so it is correctly initialiased even when not provided from JS. ([#27546](https://github.com/expo/expo/pull/27546) by [@alanjhughes](https://github.com/alanjhughes))
|
|
24
|
+
- On `iOS`, fix camera orientation on initial render. ([#27545](https://github.com/expo/expo/pull/27545) by [@alanjhughes](https://github.com/alanjhughes))
|
|
25
|
+
- On `iOS`, fix an issue where the configuration can be interuppted when the dev menu is presented on intial launch. ([#27572](https://github.com/expo/expo/pull/27572) by [@alanjhughes](https://github.com/alanjhughes))
|
|
26
|
+
|
|
27
|
+
## 14.0.6 — 2024-03-07
|
|
28
|
+
|
|
29
|
+
### 🐛 Bug fixes
|
|
30
|
+
|
|
31
|
+
- On `iOS`, fix the orientation value in `onResponsiveOrientationChanged` when `exif` is set to true. ([#27314](https://github.com/expo/expo/pull/27314) by [@alanjhughes](https://github.com/alanjhughes))
|
|
32
|
+
|
|
13
33
|
## 14.0.5 — 2024-02-16
|
|
14
34
|
|
|
15
35
|
### 🎉 New features
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '14.0
|
|
6
|
+
version = '14.1.0'
|
|
7
7
|
|
|
8
8
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
9
|
if (expoModulesCorePlugin.exists()) {
|
|
@@ -94,7 +94,7 @@ android {
|
|
|
94
94
|
namespace "expo.modules.camera"
|
|
95
95
|
defaultConfig {
|
|
96
96
|
versionCode 32
|
|
97
|
-
versionName "14.0
|
|
97
|
+
versionName "14.1.0"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera.types.d.ts","sourceRoot":"","sources":["../../src/next/Camera.types.ts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Y,GACZ,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,OAAO,CAAC;AAEZ,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Camera.types.js","sourceRoot":"","sources":["../../src/next/Camera.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAgc3B,OAAO,EAAsB,gBAAgB,EAA+C,CAAC","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n} from 'expo-modules-core';\nimport { Ref } from 'react';\nimport type { ViewProps } from 'react-native';\n\nexport type CameraType = 'front' | 'back';\n\nexport type FlashMode = 'off' | 'on' | 'auto';\n\nexport type ImageType = 'png' | 'jpg';\n\nexport type CameraMode = 'picture' | 'video';\n\n/**\n * This option specifies what codec to use when recording a video.\n * @platform ios\n */\nexport type VideoCodec = 'avc1' | 'hvc1' | 'jpeg' | 'apcn' | 'ap4h';\n\n/**\n * This option specifies the stabilization mode to use when recording a video.\n * @platform ios\n */\nexport type VideoStabilization = 'off' | 'standard' | 'cinematic' | 'auto';\n\n// @docsMissing\nexport type VideoQuality = '2160p' | '1080p' | '720p' | '480p' | '4:3';\n\nexport type CameraOrientation =\n | 'portrait'\n | 'portraitUpsideDown'\n | 'landscapeLeft'\n | 'landscapeRight';\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type ImageSize = {\n width: number;\n height: number;\n};\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type WebCameraSettings = {\n autoFocus?: string;\n flashMode?: string;\n whiteBalance?: string;\n exposureCompensation?: number;\n colorTemperature?: number;\n iso?: number;\n brightness?: number;\n contrast?: number;\n saturation?: number;\n sharpness?: number;\n focusDistance?: number;\n zoom?: number;\n};\n\n// @needsAudit\nexport type CameraCapturedPicture = {\n /**\n * Captured image width.\n */\n width: number;\n /**\n * Captured image height.\n */\n height: number;\n /**\n * On web, the value of `uri` is the same as `base64` because file system URLs are not supported in the browser.\n */\n uri: string;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n /**\n * On Android and iOS this object may include various fields based on the device and operating system.\n * On web, it is a partial representation of the [`MediaTrackSettings`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings) dictionary.\n */\n exif?: Partial<MediaTrackSettings> | any;\n};\n\n// @needsAudit\nexport type CameraPictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n */\n quality?: number;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n /**\n * Whether to also include the EXIF data for the image.\n */\n exif?: boolean;\n /**\n * Additional EXIF data to be included for the image. Only useful when `exif` option is set to `true`.\n * @platform android\n * @platform ios\n */\n additionalExif?: Record<string, any>;\n /**\n * A callback invoked when picture is saved. If set, the promise of this method will resolve immediately with no data after picture is captured.\n * The data that it should contain will be passed to this callback. If displaying or processing a captured photo right after taking it\n * is not your case, this callback lets you skip waiting for it to be saved.\n * @param picture\n */\n onPictureSaved?: (picture: CameraCapturedPicture) => void;\n // TODO(Bacon): Is it possible to implement this in the browser?\n /**\n * If set to `true`, camera skips orientation adjustment and returns an image straight from the device's camera.\n * If enabled, `quality` option is discarded (processing pipeline is skipped as a whole).\n * Although enabling this option reduces image delivery time significantly, it may cause the image to appear in a wrong orientation\n * in the `Image` component (at the time of writing, it does not respect EXIF orientation of the images).\n * > **Note**: Enabling `skipProcessing` would cause orientation uncertainty. `Image` component does not respect EXIF\n * > stored orientation information, that means obtained image would be displayed wrongly (rotated by 90°, 180° or 270°).\n * > Different devices provide different orientations. For example some Sony Xperia or Samsung devices don't provide\n * > correctly oriented images by default. To always obtain correctly oriented image disable `skipProcessing` option.\n */\n skipProcessing?: boolean;\n /**\n * @platform web\n */\n scale?: number;\n /**\n * @platform web\n */\n imageType?: ImageType;\n /**\n * @platform web\n */\n isImageMirror?: boolean;\n /**\n * @hidden\n */\n id?: number;\n /**\n * @hidden\n */\n fastMode?: boolean;\n /**\n * @hidden\n */\n maxDownsampling?: number;\n};\n\n// @needsAudit\nexport type CameraRecordingOptions = {\n /**\n * Maximum video duration in seconds.\n */\n maxDuration?: number;\n /**\n * Maximum video file size in bytes.\n */\n maxFileSize?: number;\n /**\n * If `true`, the recorded video will be flipped along the vertical axis. iOS flips videos recorded with the front camera by default,\n * but you can reverse that back by setting this to `true`. On Android, this is handled in the user's device settings.\n * @platform ios\n */\n mirror?: boolean;\n /**\n * This option specifies what codec to use when recording the video. See [`VideoCodec`](#videocodec) for the possible values.\n * @platform ios\n */\n codec?: VideoCodec;\n};\n\n/**\n * @hidden\n */\nexport type PictureSavedListener = (event: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) => void;\n\n/**\n * @hidden\n */\nexport type CameraReadyListener = () => void;\n\n/**\n * @hidden\n */\nexport type ResponsiveOrientationChangedListener = (event: {\n nativeEvent: ResponsiveOrientationChanged;\n}) => void;\n\nexport type ResponsiveOrientationChanged = { orientation: CameraOrientation };\n\n/**\n * @hidden\n */\nexport type MountErrorListener = (event: { nativeEvent: CameraMountError }) => void;\n\n// @docsMissing\nexport type CameraMountError = { message: string };\n\n// @docsMissing\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type BarcodeSize = {\n /**\n * The height value.\n */\n height: number;\n /**\n * The width value.\n */\n width: number;\n};\n\n/**\n * These coordinates are represented in the coordinate space of the camera source (e.g. when you\n * are using the camera view, these values are adjusted to the dimensions of the view).\n */\nexport type BarcodePoint = Point;\n\nexport type BarcodeBounds = {\n /**\n * The origin point of the bounding box.\n */\n origin: BarcodePoint;\n /**\n * The size of the bounding box.\n */\n size: BarcodeSize;\n};\n\n// @needsAudit\nexport type BarcodeScanningResult = {\n /**\n * The barcode type.\n */\n type: string;\n /**\n * The parsed information encoded in the barcode.\n */\n data: string;\n /**\n * The raw information encoded in the barcode.\n * May be different from `data` depending on the barcode type.\n * @platform android\n * @hidden\n */\n raw?: string;\n /**\n * Corner points of the bounding box.\n * `cornerPoints` is not always available and may be empty. On iOS, for `code39` and `pdf417`\n * you don't get this value.\n */\n cornerPoints: BarcodePoint[];\n /**\n * The [BarcodeBounds](#barcodebounds) object.\n * `bounds` in some case will be representing an empty rectangle.\n * Moreover, `bounds` doesn't have to bound the whole barcode.\n * For some types, they will represent the area used by the scanner.\n */\n bounds: BarcodeBounds;\n};\n\nexport type ScanningResult = Omit<BarcodeScanningResult, 'bounds'>;\n\n// @needsAudit\nexport type CameraProps = ViewProps & {\n /**\n * Camera facing. Use one of `CameraType`. When `front`, use the front-facing camera.\n * When `back`, use the back-facing camera.\n * @default 'back'\n */\n facing?: CameraType;\n /**\n * Camera flash mode. Use one of `FlashMode` values. When `on`, the flash on your device will\n * turn on when taking a picture. When `off`, it won't. Setting it to `auto` will fire flash if required.\n * @default 'off'\n */\n flash?: FlashMode;\n /**\n * A value between `0` and `1` being a percentage of device's max zoom. `0` - not zoomed, `1` - maximum zoom.\n * @default 0\n */\n zoom?: number;\n /**\n * Used to select image or video output\n * @default 'picture'\n */\n mode?: CameraMode;\n /**\n * If present, video will be recorded with no sound.\n * @default false\n */\n mute?: boolean;\n /**\n * Specify the quality of the recorded video. Use one of `VideoQuality` possible values:\n * for 16:9 resolution `2160p`, `1080p`, `720p`, `480p` : `Android only` and for 4:3 `4:3` (the size is 640x480).\n * If the chosen quality is not available for a device, the highest available is chosen.\n */\n videoQuality?: VideoQuality;\n /**\n * A boolean to enable or disable the torch\n * @default false\n */\n enableTorch?: boolean;\n /**\n * Callback invoked when camera preview has been set.\n */\n onCameraReady?: () => void;\n /**\n * The video stabilization mode used for a video recording. Use one of [`VideoStabilization.<value>`](#videostabilization).\n * You can read more about each stabilization type in [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturevideostabilizationmode).\n * @platform ios\n */\n videoStabilizationMode?: VideoStabilization;\n /**\n * Callback invoked when camera preview could not been started.\n * @param event Error object that contains a `message`.\n */\n onMountError?: (event: CameraMountError) => void;\n /**\n * @example\n * ```tsx\n * <CameraView\n * barcodeScannerSettings={{\n * barcodeTypes: [\"qr\"],\n * }}\n * />\n * ```\n */\n barcodeScannerSettings?: BarcodeSettings;\n /**\n * Callback that is invoked when a barcode has been successfully scanned. The callback is provided with\n * an object of the [`BarcodeScanningResult`](#barcodescanningresult) shape, where the `type`\n * refers to the barcode type that was scanned and the `data` is the information encoded in the barcode\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * for supported values.\n * @param scanningResult\n */\n onBarcodeScanned?: (scanningResult: BarcodeScanningResult) => void;\n /**\n * A URL for an image to be shown while the camera is loading.\n * @platform web\n */\n poster?: string;\n /**\n * Whether to allow responsive orientation of the camera when the screen orientation is locked (i.e. when set to `true`\n * landscape photos will be taken if the device is turned that way, even if the app or device orientation is locked to portrait)\n * @platform ios\n */\n responsiveOrientationWhenOrientationLocked?: boolean;\n /**\n * Callback invoked when responsive orientation changes. Only applicable if `responsiveOrientationWhenOrientationLocked` is `true`\n * @param event result object that contains updated orientation of camera\n * @platform ios\n */\n onResponsiveOrientationChanged?: (event: ResponsiveOrientationChanged) => void;\n};\n\n/**\n * @hidden\n */\nexport interface CameraViewRef {\n readonly takePicture: (options: CameraPictureOptions) => Promise<CameraCapturedPicture>;\n readonly record: (options?: CameraRecordingOptions) => Promise<{ uri: string }>;\n readonly stopRecording: () => Promise<void>;\n readonly launchModernScanner: () => Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport type CameraNativeProps = {\n pointerEvents?: any;\n style?: any;\n ref?: Ref<CameraViewRef>;\n onCameraReady?: CameraReadyListener;\n onMountError?: MountErrorListener;\n onBarcodeScanned?: (event: { nativeEvent: BarcodeScanningResult }) => void;\n onPictureSaved?: PictureSavedListener;\n onResponsiveOrientationChanged?: ResponsiveOrientationChangedListener;\n facing?: string;\n flashMode?: string;\n enableTorch?: boolean;\n zoom?: number;\n barcodeScannerSettings?: BarcodeSettings;\n barcodeScannerEnabled?: boolean;\n poster?: string;\n responsiveOrientationWhenOrientationLocked?: boolean;\n};\n\n// @docsMissing\nexport type BarcodeSettings = {\n barcodeTypes: BarcodeType[];\n interval?: number;\n};\n\n/**\n * @platform ios\n */\nexport type ScanningOptions = {\n /**\n * The type of codes to scan for.\n */\n barcodeTypes: BarcodeType[];\n /**\n * Indicates whether people can use a two-finger pinch-to-zoom gesture.\n * @default true\n */\n isPinchToZoomEnabled?: boolean;\n /**\n * Guidance text, such as “Slow Down,” appears over the live video.\n * @default true\n */\n isGuidanceEnabled?: boolean;\n /**\n * Indicates whether the scanner displays highlights around recognized items.\n * @default false\n */\n isHighlightingEnabled?: boolean;\n};\n\n/**\n * The available barcode types that can be scanned.\n */\nexport type BarcodeType =\n | 'aztec'\n | 'ean13'\n | 'ean8'\n | 'qr'\n | 'pdf417'\n | 'upc_e'\n | 'datamatrix'\n | 'code39'\n | 'code93'\n | 'itf14'\n | 'codabar'\n | 'code128'\n | 'upc_a';\n\nexport { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };\n"]}
|
|
1
|
+
{"version":3,"file":"Camera.types.js","sourceRoot":"","sources":["../../src/next/Camera.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,GAGjB,MAAM,mBAAmB,CAAC;AAic3B,OAAO,EAAsB,gBAAgB,EAA+C,CAAC","sourcesContent":["import {\n PermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n} from 'expo-modules-core';\nimport { Ref } from 'react';\nimport type { ViewProps } from 'react-native';\n\nexport type CameraType = 'front' | 'back';\n\nexport type FlashMode = 'off' | 'on' | 'auto';\n\nexport type ImageType = 'png' | 'jpg';\n\nexport type CameraMode = 'picture' | 'video';\n\n/**\n * This option specifies what codec to use when recording a video.\n * @platform ios\n */\nexport type VideoCodec = 'avc1' | 'hvc1' | 'jpeg' | 'apcn' | 'ap4h';\n\n/**\n * This option specifies the stabilization mode to use when recording a video.\n * @platform ios\n */\nexport type VideoStabilization = 'off' | 'standard' | 'cinematic' | 'auto';\n\n// @docsMissing\nexport type VideoQuality = '2160p' | '1080p' | '720p' | '480p' | '4:3';\n\nexport type CameraOrientation =\n | 'portrait'\n | 'portraitUpsideDown'\n | 'landscapeLeft'\n | 'landscapeRight';\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type ImageSize = {\n width: number;\n height: number;\n};\n\n// @docsMissing\n/**\n * @hidden We do not expose related web methods in docs.\n * @platform web\n */\nexport type WebCameraSettings = {\n autoFocus?: string;\n flashMode?: string;\n whiteBalance?: string;\n exposureCompensation?: number;\n colorTemperature?: number;\n iso?: number;\n brightness?: number;\n contrast?: number;\n saturation?: number;\n sharpness?: number;\n focusDistance?: number;\n zoom?: number;\n};\n\n// @needsAudit\nexport type CameraCapturedPicture = {\n /**\n * Captured image width.\n */\n width: number;\n /**\n * Captured image height.\n */\n height: number;\n /**\n * On web, the value of `uri` is the same as `base64` because file system URLs are not supported in the browser.\n */\n uri: string;\n /**\n * A Base64 representation of the image.\n */\n base64?: string;\n /**\n * On Android and iOS this object may include various fields based on the device and operating system.\n * On web, it is a partial representation of the [`MediaTrackSettings`](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings) dictionary.\n */\n exif?: Partial<MediaTrackSettings> | any;\n};\n\n// @needsAudit\nexport type CameraPictureOptions = {\n /**\n * Specify the compression quality from `0` to `1`. `0` means compress for small size, and `1` means compress for maximum quality.\n */\n quality?: number;\n /**\n * Whether to also include the image data in Base64 format.\n */\n base64?: boolean;\n /**\n * Whether to also include the EXIF data for the image.\n */\n exif?: boolean;\n /**\n * Additional EXIF data to be included for the image. Only useful when `exif` option is set to `true`.\n * @platform android\n * @platform ios\n */\n additionalExif?: Record<string, any>;\n /**\n * A callback invoked when picture is saved. If set, the promise of this method will resolve immediately with no data after picture is captured.\n * The data that it should contain will be passed to this callback. If displaying or processing a captured photo right after taking it\n * is not your case, this callback lets you skip waiting for it to be saved.\n * @param picture\n */\n onPictureSaved?: (picture: CameraCapturedPicture) => void;\n // TODO(Bacon): Is it possible to implement this in the browser?\n /**\n * If set to `true`, camera skips orientation adjustment and returns an image straight from the device's camera.\n * If enabled, `quality` option is discarded (processing pipeline is skipped as a whole).\n * Although enabling this option reduces image delivery time significantly, it may cause the image to appear in a wrong orientation\n * in the `Image` component (at the time of writing, it does not respect EXIF orientation of the images).\n * > **Note**: Enabling `skipProcessing` would cause orientation uncertainty. `Image` component does not respect EXIF\n * > stored orientation information, that means obtained image would be displayed wrongly (rotated by 90°, 180° or 270°).\n * > Different devices provide different orientations. For example some Sony Xperia or Samsung devices don't provide\n * > correctly oriented images by default. To always obtain correctly oriented image disable `skipProcessing` option.\n */\n skipProcessing?: boolean;\n /**\n * @platform web\n */\n scale?: number;\n /**\n * @platform web\n */\n imageType?: ImageType;\n /**\n * @platform web\n */\n isImageMirror?: boolean;\n /**\n * @hidden\n */\n id?: number;\n /**\n * @hidden\n */\n fastMode?: boolean;\n /**\n * @hidden\n */\n maxDownsampling?: number;\n};\n\n// @needsAudit\nexport type CameraRecordingOptions = {\n /**\n * Maximum video duration in seconds.\n */\n maxDuration?: number;\n /**\n * Maximum video file size in bytes.\n */\n maxFileSize?: number;\n /**\n * If `true`, the recorded video will be flipped along the vertical axis. iOS flips videos recorded with the front camera by default,\n * but you can reverse that back by setting this to `true`. On Android, this is handled in the user's device settings.\n * @platform ios\n */\n mirror?: boolean;\n /**\n * This option specifies what codec to use when recording the video. See [`VideoCodec`](#videocodec) for the possible values.\n * @platform ios\n */\n codec?: VideoCodec;\n};\n\n/**\n * @hidden\n */\nexport type PictureSavedListener = (event: {\n nativeEvent: { data: CameraCapturedPicture; id: number };\n}) => void;\n\n/**\n * @hidden\n */\nexport type CameraReadyListener = () => void;\n\n/**\n * @hidden\n */\nexport type ResponsiveOrientationChangedListener = (event: {\n nativeEvent: ResponsiveOrientationChanged;\n}) => void;\n\nexport type ResponsiveOrientationChanged = { orientation: CameraOrientation };\n\n/**\n * @hidden\n */\nexport type MountErrorListener = (event: { nativeEvent: CameraMountError }) => void;\n\n// @docsMissing\nexport type CameraMountError = { message: string };\n\n// @docsMissing\nexport type Point = {\n x: number;\n y: number;\n};\n\nexport type BarcodeSize = {\n /**\n * The height value.\n */\n height: number;\n /**\n * The width value.\n */\n width: number;\n};\n\n/**\n * These coordinates are represented in the coordinate space of the camera source (e.g. when you\n * are using the camera view, these values are adjusted to the dimensions of the view).\n */\nexport type BarcodePoint = Point;\n\nexport type BarcodeBounds = {\n /**\n * The origin point of the bounding box.\n */\n origin: BarcodePoint;\n /**\n * The size of the bounding box.\n */\n size: BarcodeSize;\n};\n\n// @needsAudit\nexport type BarcodeScanningResult = {\n /**\n * The barcode type.\n */\n type: string;\n /**\n * The parsed information encoded in the barcode.\n */\n data: string;\n /**\n * The raw information encoded in the barcode.\n * May be different from `data` depending on the barcode type.\n * @platform android\n * @hidden\n */\n raw?: string;\n /**\n * Corner points of the bounding box.\n * `cornerPoints` is not always available and may be empty. On iOS, for `code39` and `pdf417`\n * you don't get this value.\n */\n cornerPoints: BarcodePoint[];\n /**\n * The [BarcodeBounds](#barcodebounds) object.\n * `bounds` in some case will be representing an empty rectangle.\n * Moreover, `bounds` doesn't have to bound the whole barcode.\n * For some types, they will represent the area used by the scanner.\n */\n bounds: BarcodeBounds;\n};\n\nexport type ScanningResult = Omit<BarcodeScanningResult, 'bounds'>;\n\n// @needsAudit\nexport type CameraProps = ViewProps & {\n /**\n * Camera facing. Use one of `CameraType`. When `front`, use the front-facing camera.\n * When `back`, use the back-facing camera.\n * @default 'back'\n */\n facing?: CameraType;\n /**\n * Camera flash mode. Use one of `FlashMode` values. When `on`, the flash on your device will\n * turn on when taking a picture. When `off`, it won't. Setting it to `auto` will fire flash if required.\n * @default 'off'\n */\n flash?: FlashMode;\n /**\n * A value between `0` and `1` being a percentage of device's max zoom. `0` - not zoomed, `1` - maximum zoom.\n * @default 0\n */\n zoom?: number;\n /**\n * Used to select image or video output\n * @default 'picture'\n */\n mode?: CameraMode;\n /**\n * If present, video will be recorded with no sound.\n * @default false\n */\n mute?: boolean;\n /**\n * Specify the quality of the recorded video. Use one of `VideoQuality` possible values:\n * for 16:9 resolution `2160p`, `1080p`, `720p`, `480p` : `Android only` and for 4:3 `4:3` (the size is 640x480).\n * If the chosen quality is not available for a device, the highest available is chosen.\n */\n videoQuality?: VideoQuality;\n /**\n * A boolean to enable or disable the torch\n * @default false\n */\n enableTorch?: boolean;\n /**\n * Callback invoked when camera preview has been set.\n */\n onCameraReady?: () => void;\n /**\n * The video stabilization mode used for a video recording. Use one of [`VideoStabilization.<value>`](#videostabilization).\n * You can read more about each stabilization type in [Apple Documentation](https://developer.apple.com/documentation/avfoundation/avcapturevideostabilizationmode).\n * @platform ios\n */\n videoStabilizationMode?: VideoStabilization;\n /**\n * Callback invoked when camera preview could not been started.\n * @param event Error object that contains a `message`.\n */\n onMountError?: (event: CameraMountError) => void;\n /**\n * @example\n * ```tsx\n * <CameraView\n * barcodeScannerSettings={{\n * barcodeTypes: [\"qr\"],\n * }}\n * />\n * ```\n */\n barcodeScannerSettings?: BarcodeSettings;\n /**\n * Callback that is invoked when a barcode has been successfully scanned. The callback is provided with\n * an object of the [`BarcodeScanningResult`](#barcodescanningresult) shape, where the `type`\n * refers to the barcode type that was scanned and the `data` is the information encoded in the barcode\n * (in this case of QR codes, this is often a URL). See [`BarcodeType`](#barcodetype) for supported values.\n * for supported values.\n * @param scanningResult\n */\n onBarcodeScanned?: (scanningResult: BarcodeScanningResult) => void;\n /**\n * A URL for an image to be shown while the camera is loading.\n * @platform web\n */\n poster?: string;\n /**\n * Whether to allow responsive orientation of the camera when the screen orientation is locked (i.e. when set to `true`\n * landscape photos will be taken if the device is turned that way, even if the app or device orientation is locked to portrait)\n * @platform ios\n */\n responsiveOrientationWhenOrientationLocked?: boolean;\n /**\n * Callback invoked when responsive orientation changes. Only applicable if `responsiveOrientationWhenOrientationLocked` is `true`\n * @param event result object that contains updated orientation of camera\n * @platform ios\n */\n onResponsiveOrientationChanged?: (event: ResponsiveOrientationChanged) => void;\n};\n\n/**\n * @hidden\n */\nexport interface CameraViewRef {\n readonly takePicture: (options: CameraPictureOptions) => Promise<CameraCapturedPicture>;\n readonly record: (options?: CameraRecordingOptions) => Promise<{ uri: string }>;\n readonly stopRecording: () => Promise<void>;\n readonly launchModernScanner: () => Promise<void>;\n}\n\n/**\n * @hidden\n */\nexport type CameraNativeProps = {\n pointerEvents?: any;\n style?: any;\n ref?: Ref<CameraViewRef>;\n onCameraReady?: CameraReadyListener;\n onMountError?: MountErrorListener;\n onBarcodeScanned?: (event: { nativeEvent: BarcodeScanningResult }) => void;\n onPictureSaved?: PictureSavedListener;\n onResponsiveOrientationChanged?: ResponsiveOrientationChangedListener;\n facing?: string;\n flashMode?: string;\n enableTorch?: boolean;\n mute?: boolean;\n zoom?: number;\n barcodeScannerSettings?: BarcodeSettings;\n barcodeScannerEnabled?: boolean;\n poster?: string;\n responsiveOrientationWhenOrientationLocked?: boolean;\n};\n\n// @docsMissing\nexport type BarcodeSettings = {\n barcodeTypes: BarcodeType[];\n interval?: number;\n};\n\n/**\n * @platform ios\n */\nexport type ScanningOptions = {\n /**\n * The type of codes to scan for.\n */\n barcodeTypes: BarcodeType[];\n /**\n * Indicates whether people can use a two-finger pinch-to-zoom gesture.\n * @default true\n */\n isPinchToZoomEnabled?: boolean;\n /**\n * Guidance text, such as “Slow Down,” appears over the live video.\n * @default true\n */\n isGuidanceEnabled?: boolean;\n /**\n * Indicates whether the scanner displays highlights around recognized items.\n * @default false\n */\n isHighlightingEnabled?: boolean;\n};\n\n/**\n * The available barcode types that can be scanned.\n */\nexport type BarcodeType =\n | 'aztec'\n | 'ean13'\n | 'ean8'\n | 'qr'\n | 'pdf417'\n | 'upc_e'\n | 'datamatrix'\n | 'code39'\n | 'code93'\n | 'itf14'\n | 'codabar'\n | 'code128'\n | 'upc_a';\n\nexport { PermissionResponse, PermissionStatus, PermissionExpiration, PermissionHookOptions };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/next/utils/props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIxF,eAAO,MAAM,gBAAgB,EAAE;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;CAIhE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAgBzE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,iBAAiB,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/next/utils/props.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIxF,eAAO,MAAM,gBAAgB,EAAE;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,UAAU,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5D,KAAK,EAAE,MAAM,CAAC,MAAM,SAAS,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;CAIhE,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAgBzE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,iBAAiB,CAYxE"}
|
|
@@ -23,6 +23,8 @@ export function convertNativeProps(props) {
|
|
|
23
23
|
export function ensureNativeProps(props) {
|
|
24
24
|
const newProps = convertNativeProps(props);
|
|
25
25
|
newProps.barcodeScannerEnabled = !!newProps.onBarcodeScanned;
|
|
26
|
+
newProps.flashMode = props?.flash ?? 'off';
|
|
27
|
+
newProps.mute = props?.mute ?? false;
|
|
26
28
|
if (Platform.OS !== 'web') {
|
|
27
29
|
delete newProps.poster;
|
|
28
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../src/next/utils/props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,aAAa,MAAM,sBAAsB,CAAC;AAEjD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAGzB;IACF,IAAI,EAAE,aAAa,CAAC,IAAI;IACxB,KAAK,EAAE,aAAa,CAAC,SAAS;CAC/B,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,KAAmB;IACpD,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QACvC,OAAO,EAAE,CAAC;KACX;IAED,MAAM,WAAW,GAAsB,EAAE,CAAC;IAE1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAChD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,EAAE;YACtD,WAAW,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;SACjD;aAAM;YACL,WAAW,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC1B;KACF;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAmB;IACnD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE3C,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AQ,CAAC,EAAE,KAAK,KAAK,EAAE;QACzB,OAAO,QAAQ,CAAC,MAAM,CAAC;KACxB;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import { Platform } from 'expo-modules-core';\n\nimport { CameraNativeProps, CameraType, FlashMode, CameraProps } from '../Camera.types';\nimport CameraManager from '../ExpoCameraManager';\n\n// Values under keys from this object will be transformed to native options\nexport const ConversionTables: {\n type: Record<keyof CameraType, CameraNativeProps['facing']>;\n flash: Record<keyof FlashMode, CameraNativeProps['flashMode']>;\n} = {\n type: CameraManager.Type,\n flash: CameraManager.FlashMode,\n};\n\nexport function convertNativeProps(props?: CameraProps): CameraNativeProps {\n if (!props || typeof props !== 'object') {\n return {};\n }\n\n const nativeProps: CameraNativeProps = {};\n\n for (const [key, value] of Object.entries(props)) {\n if (typeof value === 'string' && ConversionTables[key]) {\n nativeProps[key] = ConversionTables[key][value];\n } else {\n nativeProps[key] = value;\n }\n }\n\n return nativeProps;\n}\n\nexport function ensureNativeProps(props?: CameraProps): CameraNativeProps {\n const newProps = convertNativeProps(props);\n\n newProps.barcodeScannerEnabled = !!newProps.onBarcodeScanned;\n newProps.flashMode = props?.flash ?? 'off';\n newProps.mute = props?.mute ?? false;\n\n if (Platform.OS !== 'web') {\n delete newProps.poster;\n }\n\n return newProps;\n}\n"]}
|
package/ios/CameraView.swift
CHANGED
|
@@ -131,7 +131,6 @@ public class CameraView: ExpoView, EXCameraInterface, EXAppLifecycleListener,
|
|
|
131
131
|
previewLayer?.videoGravity = .resizeAspectFill
|
|
132
132
|
previewLayer?.needsDisplayOnBoundsChange = true
|
|
133
133
|
#endif
|
|
134
|
-
self.changePreviewOrientation(orientation: UIApplication.shared.statusBarOrientation)
|
|
135
134
|
self.initializeCaptureSessionInput()
|
|
136
135
|
self.startSession()
|
|
137
136
|
NotificationCenter.default.addObserver(
|
|
@@ -236,6 +235,7 @@ public class CameraView: ExpoView, EXCameraInterface, EXAppLifecycleListener,
|
|
|
236
235
|
}
|
|
237
236
|
|
|
238
237
|
self.addErrorNotification()
|
|
238
|
+
self.changePreviewOrientation()
|
|
239
239
|
|
|
240
240
|
self.sessionQueue.asyncAfter(deadline: .now() + round(50 / 1_000_000)) {
|
|
241
241
|
self.maybeStartFaceDetection(self.presetCamera != .back)
|
|
@@ -412,11 +412,8 @@ public class CameraView: ExpoView, EXCameraInterface, EXAppLifecycleListener,
|
|
|
412
412
|
let connection = photoOutput.connection(with: .video)
|
|
413
413
|
let orientation = self.responsiveWhenOrientationLocked ? self.physicalOrientation : UIDevice.current.orientation
|
|
414
414
|
connection?.videoOrientation = ExpoCameraUtils.videoOrientation(for: orientation)
|
|
415
|
-
let photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey:
|
|
415
|
+
let photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.jpeg])
|
|
416
416
|
|
|
417
|
-
if photoOutput.isHighResolutionCaptureEnabled {
|
|
418
|
-
photoSettings.isHighResolutionPhotoEnabled = true
|
|
419
|
-
}
|
|
420
417
|
var requestedFlashMode = AVCaptureDevice.FlashMode.off
|
|
421
418
|
|
|
422
419
|
switch self.flashMode {
|
|
@@ -910,13 +907,12 @@ public class CameraView: ExpoView, EXCameraInterface, EXAppLifecycleListener,
|
|
|
910
907
|
}
|
|
911
908
|
|
|
912
909
|
@objc func orientationChanged(notification: Notification) {
|
|
913
|
-
changePreviewOrientation(
|
|
910
|
+
changePreviewOrientation()
|
|
914
911
|
}
|
|
915
912
|
|
|
916
|
-
func changePreviewOrientation(
|
|
917
|
-
let videoOrientation = ExpoCameraUtils.videoOrientation(for: orientation)
|
|
918
|
-
|
|
913
|
+
func changePreviewOrientation() {
|
|
919
914
|
EXUtilities.performSynchronously {
|
|
915
|
+
let videoOrientation = ExpoCameraUtils.videoOrientation(for: self.deviceOrientation)
|
|
920
916
|
if (self.previewLayer?.connection?.isVideoOrientationSupported) == true {
|
|
921
917
|
self.previewLayer?.connection?.videoOrientation = videoOrientation
|
|
922
918
|
}
|
|
@@ -48,9 +48,9 @@ struct ExpoCameraUtils {
|
|
|
48
48
|
case .portraitUpsideDown:
|
|
49
49
|
return .portraitUpsideDown
|
|
50
50
|
case .landscapeLeft:
|
|
51
|
-
return .landscapeLeft
|
|
52
|
-
case .landscapeRight:
|
|
53
51
|
return .landscapeRight
|
|
52
|
+
case .landscapeRight:
|
|
53
|
+
return .landscapeLeft
|
|
54
54
|
default:
|
|
55
55
|
return .portrait
|
|
56
56
|
}
|
|
@@ -115,9 +115,9 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
115
115
|
#if !targetEnvironment(simulator)
|
|
116
116
|
setupPreview()
|
|
117
117
|
#endif
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
UIDevice.current.beginGeneratingDeviceOrientationNotifications()
|
|
119
|
+
initializeCaptureSessionInput()
|
|
120
|
+
startSession()
|
|
121
121
|
NotificationCenter.default.addObserver(
|
|
122
122
|
self,
|
|
123
123
|
selector: #selector(orientationChanged(notification:)),
|
|
@@ -199,10 +199,6 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
sessionQueue.async {
|
|
202
|
-
if self.presetCamera == .unspecified {
|
|
203
|
-
return
|
|
204
|
-
}
|
|
205
|
-
|
|
206
202
|
self.session.beginConfiguration()
|
|
207
203
|
|
|
208
204
|
let photoOutput = AVCapturePhotoOutput()
|
|
@@ -212,10 +208,13 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
212
208
|
self.photoOutput = photoOutput
|
|
213
209
|
}
|
|
214
210
|
|
|
211
|
+
self.addErrorNotification()
|
|
212
|
+
self.changePreviewOrientation()
|
|
213
|
+
self.session.commitConfiguration()
|
|
214
|
+
|
|
215
215
|
// Delay starting the scanner
|
|
216
216
|
self.sessionQueue.asyncAfter(deadline: .now() + 0.5) {
|
|
217
217
|
self.barcodeScanner.maybeStartBarcodeScanning()
|
|
218
|
-
self.session.commitConfiguration()
|
|
219
218
|
self.session.startRunning()
|
|
220
219
|
self.onCameraReady()
|
|
221
220
|
}
|
|
@@ -239,7 +238,7 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
239
238
|
|
|
240
239
|
private func addErrorNotification() {
|
|
241
240
|
if self.errorNotification != nil {
|
|
242
|
-
NotificationCenter.default.removeObserver(self.errorNotification)
|
|
241
|
+
NotificationCenter.default.removeObserver(self.errorNotification as Any)
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
self.errorNotification = NotificationCenter.default.addObserver(
|
|
@@ -254,9 +253,9 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
254
253
|
}
|
|
255
254
|
|
|
256
255
|
if error.code == .mediaServicesWereReset {
|
|
257
|
-
if self.session.isRunning {
|
|
256
|
+
if !self.session.isRunning {
|
|
258
257
|
self.session.startRunning()
|
|
259
|
-
self.
|
|
258
|
+
self.updateSessionAudioIsMuted()
|
|
260
259
|
self.onCameraReady()
|
|
261
260
|
}
|
|
262
261
|
}
|
|
@@ -282,7 +281,7 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
282
281
|
default: physicalOrientation)
|
|
283
282
|
if deviceOrientation != self.physicalOrientation {
|
|
284
283
|
self.physicalOrientation = deviceOrientation
|
|
285
|
-
onResponsiveOrientationChanged(["orientation": deviceOrientation
|
|
284
|
+
onResponsiveOrientationChanged(["orientation": ExpoCameraUtilsNext.toOrientationString(orientation: deviceOrientation)])
|
|
286
285
|
}
|
|
287
286
|
}
|
|
288
287
|
} else {
|
|
@@ -308,11 +307,8 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
308
307
|
let connection = photoOutput.connection(with: .video)
|
|
309
308
|
let orientation = self.responsiveWhenOrientationLocked ? self.physicalOrientation : UIDevice.current.orientation
|
|
310
309
|
connection?.videoOrientation = ExpoCameraUtils.videoOrientation(for: orientation)
|
|
311
|
-
let photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey:
|
|
310
|
+
let photoSettings = AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.jpeg])
|
|
312
311
|
|
|
313
|
-
if photoOutput.isHighResolutionCaptureEnabled {
|
|
314
|
-
photoSettings.isHighResolutionPhotoEnabled = true
|
|
315
|
-
}
|
|
316
312
|
var requestedFlashMode = AVCaptureDevice.FlashMode.off
|
|
317
313
|
|
|
318
314
|
switch self.flashMode {
|
|
@@ -438,7 +434,7 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
438
434
|
guard let exifDict = metadata[kCGImagePropertyExifDictionary as String] as? NSDictionary else {
|
|
439
435
|
return
|
|
440
436
|
}
|
|
441
|
-
|
|
437
|
+
let updatedExif = ExpoCameraUtils.updateExif(
|
|
442
438
|
metadata: exifDict,
|
|
443
439
|
with: ["Orientation": ExpoCameraUtils.export(orientation: takenImage.imageOrientation)]
|
|
444
440
|
)
|
|
@@ -574,6 +570,7 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
574
570
|
}
|
|
575
571
|
}
|
|
576
572
|
|
|
573
|
+
// Must be called on the sessionQueue
|
|
577
574
|
func updateSessionAudioIsMuted() {
|
|
578
575
|
sessionQueue.async {
|
|
579
576
|
self.session.beginConfiguration()
|
|
@@ -605,17 +602,18 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
605
602
|
}
|
|
606
603
|
}
|
|
607
604
|
|
|
605
|
+
// Must be called on the sessionQueue
|
|
608
606
|
func setupMovieFileCapture() {
|
|
609
607
|
let output = AVCaptureMovieFileOutput()
|
|
610
608
|
if self.session.canAddOutput(output) {
|
|
611
609
|
self.session.beginConfiguration()
|
|
612
610
|
self.session.addOutput(output)
|
|
613
|
-
self.session.sessionPreset = .high
|
|
614
611
|
self.videoFileOutput = output
|
|
615
612
|
self.session.commitConfiguration()
|
|
616
613
|
}
|
|
617
614
|
}
|
|
618
615
|
|
|
616
|
+
// Must be called on the sessionQueue
|
|
619
617
|
func cleanupMovieFileCapture() {
|
|
620
618
|
if let videoFileOutput {
|
|
621
619
|
if session.outputs.contains(videoFileOutput) {
|
|
@@ -636,15 +634,10 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
636
634
|
public override func removeFromSuperview() {
|
|
637
635
|
lifecycleManager?.unregisterAppLifecycleListener(self)
|
|
638
636
|
super.removeFromSuperview()
|
|
637
|
+
UIDevice.current.endGeneratingDeviceOrientationNotifications()
|
|
639
638
|
NotificationCenter.default.removeObserver(self, name: UIDevice.orientationDidChangeNotification, object: nil)
|
|
640
639
|
}
|
|
641
640
|
|
|
642
|
-
func ensureSessionConfiguration() {
|
|
643
|
-
sessionQueue.async {
|
|
644
|
-
self.updateSessionAudioIsMuted()
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
|
|
648
641
|
public func fileOutput(
|
|
649
642
|
_ output: AVCaptureFileOutput,
|
|
650
643
|
didFinishRecordingTo outputFileURL: URL,
|
|
@@ -678,14 +671,15 @@ public class CameraViewNext: ExpoView, EXCameraInterface, EXAppLifecycleListener
|
|
|
678
671
|
}
|
|
679
672
|
}
|
|
680
673
|
|
|
681
|
-
|
|
682
|
-
|
|
674
|
+
// Must be called on the sessionQueue
|
|
675
|
+
func updateSessionPreset(preset: AVCaptureSession.Preset) {
|
|
676
|
+
#if !targetEnvironment(simulator)
|
|
683
677
|
if self.session.canSetSessionPreset(preset) {
|
|
684
678
|
self.session.beginConfiguration()
|
|
685
679
|
self.session.sessionPreset = preset
|
|
686
680
|
self.session.commitConfiguration()
|
|
687
681
|
}
|
|
688
|
-
|
|
682
|
+
#endif
|
|
689
683
|
}
|
|
690
684
|
|
|
691
685
|
func initializeCaptureSessionInput() {
|
|
@@ -693,16 +687,6 @@ func updateSessionPreset(preset: AVCaptureSession.Preset) {
|
|
|
693
687
|
return
|
|
694
688
|
}
|
|
695
689
|
|
|
696
|
-
EXUtilities.performSynchronously {
|
|
697
|
-
var orientation: AVCaptureVideoOrientation = .portrait
|
|
698
|
-
if self.deviceOrientation != .unknown {
|
|
699
|
-
if let videoOrientation = AVCaptureVideoOrientation(rawValue: self.deviceOrientation.rawValue) {
|
|
700
|
-
orientation = videoOrientation
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
self.previewLayer.videoPreviewLayer.connection?.videoOrientation = orientation
|
|
704
|
-
}
|
|
705
|
-
|
|
706
690
|
sessionQueue.async {
|
|
707
691
|
self.session.beginConfiguration()
|
|
708
692
|
|
|
@@ -753,13 +737,13 @@ func updateSessionPreset(preset: AVCaptureSession.Preset) {
|
|
|
753
737
|
}
|
|
754
738
|
|
|
755
739
|
@objc func orientationChanged(notification: Notification) {
|
|
756
|
-
changePreviewOrientation(
|
|
740
|
+
changePreviewOrientation()
|
|
757
741
|
}
|
|
758
742
|
|
|
759
|
-
func changePreviewOrientation(
|
|
760
|
-
let videoOrientation = ExpoCameraUtils.videoOrientation(for: orientation)
|
|
761
|
-
|
|
743
|
+
func changePreviewOrientation() {
|
|
762
744
|
EXUtilities.performSynchronously {
|
|
745
|
+
// We shouldn't access the device orientation anywhere but on the main thread
|
|
746
|
+
let videoOrientation = ExpoCameraUtils.videoOrientation(for: self.deviceOrientation)
|
|
763
747
|
if (self.previewLayer.videoPreviewLayer.connection?.isVideoOrientationSupported) == true {
|
|
764
748
|
self.previewLayer.videoPreviewLayer.connection?.videoOrientation = videoOrientation
|
|
765
749
|
}
|
|
@@ -56,6 +56,27 @@ struct ExpoCameraUtilsNext {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
static func toOrientationString(orientation: UIDeviceOrientation) -> String {
|
|
60
|
+
switch orientation {
|
|
61
|
+
case .portrait:
|
|
62
|
+
return "portrait"
|
|
63
|
+
case .landscapeLeft:
|
|
64
|
+
return "landscapeLeft"
|
|
65
|
+
case .landscapeRight:
|
|
66
|
+
return "landscapeRight"
|
|
67
|
+
case .portraitUpsideDown:
|
|
68
|
+
return "portraitUpsideDown"
|
|
69
|
+
case .faceDown:
|
|
70
|
+
return "faceDown"
|
|
71
|
+
case .faceUp:
|
|
72
|
+
return "faceUp"
|
|
73
|
+
case .unknown:
|
|
74
|
+
return "unknown"
|
|
75
|
+
@unknown default:
|
|
76
|
+
return "unknown"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
59
80
|
static func export(orientation: UIImage.Orientation) -> Int {
|
|
60
81
|
switch orientation {
|
|
61
82
|
case .left:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-camera",
|
|
3
|
-
"version": "14.0
|
|
3
|
+
"version": "14.1.0",
|
|
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": "
|
|
45
|
+
"gitHead": "d846eb40fc384b9e4b21260af2a990dfe79cf461"
|
|
46
46
|
}
|
package/src/next/Camera.types.ts
CHANGED
package/src/next/utils/props.ts
CHANGED
|
@@ -34,6 +34,8 @@ export function ensureNativeProps(props?: CameraProps): CameraNativeProps {
|
|
|
34
34
|
const newProps = convertNativeProps(props);
|
|
35
35
|
|
|
36
36
|
newProps.barcodeScannerEnabled = !!newProps.onBarcodeScanned;
|
|
37
|
+
newProps.flashMode = props?.flash ?? 'off';
|
|
38
|
+
newProps.mute = props?.mute ?? false;
|
|
37
39
|
|
|
38
40
|
if (Platform.OS !== 'web') {
|
|
39
41
|
delete newProps.poster;
|