* - Improve Android code so skipProcessing is not needed, the code is more in line with iOS, and is "fast" by default. This means that skipProcessing is no longer needed (nor used), and adding additional options will "slow down" the capture as expected, rather than having always a lot of processing. This shouldn't be a breaking change.
- document the writeExif option, and implement it for iOS as well.
* Release CF object which could cause a memleak
* This update tries to improve audio recording interruptions on iOS due to phone calls or background music.
- Use a more generic event to handle session interruptions. This removes the need to listen to foreground/background events, and stopping the session this way was actually redundant/wrong (see https://forums.developer.apple.com/thread/61406). This also makes session stopping detection more reliable (calls, suspension due to a call or notification, etc., which would previously not set the recording interrupted flag on every case)
From the above docs: "No, incorrect. You _never_ need to stop your capture session. The capture session automatically stops itself when your app goes to the background and resumes itself when you come back to the foreground."
- Allow for `captureAudio` updates to also update the audio connections internally so the prop can be correctly updated on the fly without remounting.
- add onAudioInterrupted and onAudioConnected events so the UI can handle scenarios where audio is wanted but not available. This should also help in keeping the preview active even if audio is interrupted and we have captureAudio={true}. Lastly, it can be used to detect if we can record audio or not due to the dummy implementation of the audio permission on iOS always returning true.
- check, activate, and release audio sessions (if captureAudio) so we can detect early if audio is available before attempting to connect the input. This will also allow us to detect if we can record even if there was already a call before opening the camera.
- use proper observer for session error instead of of the strong self block. No benefit, but makes code more readable and allows access to instance variables
- getDeviceOrientationWithBlock might fire more than once under some circumstances, ending up taking a picture or video twice. Add a lock and additional check to prevent this.
* no need for change check,
* do not resume audio if we were hinted not to (e.g., music playback happening)
* start session here also on session queue.
* check for session running before trying to record or capture.
This should fix a possible race condition where both the session start call happens at the same time as the record call
* no need to set orientation on constructor, and set it on session queue to prevent race conditions
* move device init and checks also to session queue. This prevents possible double initializations.
* feat: autoexposure on point of interest and defocus on subject change
* Impelement cameraIds for iOS, and various iOS bug fixes.
Summary:
- Implement getCameraIds and cameraId property to manually select a camera device.
- Fix the internal preset being used to properly use a photo and video preset, and check for invalid presets on camera switch.
- This fixes a bug that would happen after recording. After a recording is complete, the camera preset was set to 4k permanently, and attempting to select any camera that does not support that preset would result in an totally unusable camera. Now, the "Photo" preset is the default which should be the highest quality option for photos, and the previously used "High" preset will be used as video default if no value is provided.
- This also adds proper support to setting the undocumented "pictureSize" property. Setting this property will change the default photo quality to be that one.
- Minor cleanup to the camera initialization so the same code is not called as many times redundantly (start session / device happening multiple times)
- The reduced redundant calls to start session and session updates should make the camera startup slightly faster.
- Fix for warnings issued due to misuse of the "isRecording" property. This property was defined as both as a property and a method and was both getting set manually and retrieved with a function. It should now consistently only be retrieved with a function based on the real recording status. Should have no behaivour change, but removes a pesky warning.
- Fix an issue related to the camera getting stuck after a background resume by removing the use of the queue for those two events.
- Fixes a wrong event unsubscription (UIDeviceOrientationDidChangeNotification to UIApplicationDidChangeStatusBarOrientationNotification) from a previous change. Also move event subscriptions to superview changes for consistency and so they are not used/consumed if not needed. After testing, the View of RNCamera is instantiated twice (for some reason I couldn't find) but used only once. RN keeps a reference to the view in memory even after the camera is destroyed, resulting in these events getting fired and handled all the time during the app's lifetime.
* add maxZoom property to iOS.
Android: Not needed as of now. Also, zoom multiplier behaves different on Android and can't be used with the same value as iOS.
* add auto exposure option.
This branch is temporary from the other changes until the proper changes from https://github.com/react-native-community/react-native-camera/pull/2423/files are merged.
* allow for expose POI to also be cleared
* Add ultra-wide lense support. Requires XCode with SDK for iOS 13
* check that video capture device is ready before capturing, fix for string cameraId assignment
* add missing ios 13 camera types and exposure check.
* remove duplicates from camera id list, return its type on IOS, handle WB crash on unsupported devices.
* Do not return virtual devices (we can't really use them with the library), update zoom and flash on preset change so they are maintained while recording/restoring.
* remove redundant duplicates check, add SDK macro check for ultra wide lenses, remove virtual cameras from query
* Add more info about deviceType and iOS camera IDs behaviour.
* Impelement cameraIds for iOS, and various iOS bug fixes.
Summary:
- Implement getCameraIds and cameraId property to manually select a camera device.
- Fix the internal preset being used to properly use a photo and video preset, and check for invalid presets on camera switch.
- This fixes a bug that would happen after recording. After a recording is complete, the camera preset was set to 4k permanently, and attempting to select any camera that does not support that preset would result in an totally unusable camera. Now, the "Photo" preset is the default which should be the highest quality option for photos, and the previously used "High" preset will be used as video default if no value is provided.
- This also adds proper support to setting the undocumented "pictureSize" property. Setting this property will change the default photo quality to be that one.
- Minor cleanup to the camera initialization so the same code is not called as many times redundantly (start session / device happening multiple times)
- The reduced redundant calls to start session and session updates should make the camera startup slightly faster.
- Fix for warnings issued due to misuse of the "isRecording" property. This property was defined as both as a property and a method and was both getting set manually and retrieved with a function. It should now consistently only be retrieved with a function based on the real recording status. Should have no behaivour change, but removes a pesky warning.
- Fix an issue related to the camera getting stuck after a background resume by removing the use of the queue for those two events.
- Fixes a wrong event unsubscription (UIDeviceOrientationDidChangeNotification to UIApplicationDidChangeStatusBarOrientationNotification) from a previous change. Also move event subscriptions to superview changes for consistency and so they are not used/consumed if not needed. After testing, the View of RNCamera is instantiated twice (for some reason I couldn't find) but used only once. RN keeps a reference to the view in memory even after the camera is destroyed, resulting in these events getting fired and handled all the time during the app's lifetime.
* add maxZoom property to iOS.
Android: Not needed as of now. Also, zoom multiplier behaves different on Android and can't be used with the same value as iOS.
* Update RNCamera.m
Add videoBitrate option for ios, setting video bitrate requires a codec to be set
* Update API documentation
* Update documentation
* Update typings
Currently, the `onStatusChange` has a type of
```ts
onStatusChange?(event: {
cameraStatus: CameraStatus;
recordAudioPermissionStatus: keyof RecordAudioPermissionStatus;
}): void
```
Which makes it very inconvenient to use with Typescript, having to set the `cameraStatus` field to `any` in the passed function:
```ts
const handleStatusChange = (event: {cameraStatus: any}) => {
if (event.cameraStatus === 'NOT_AUTHORIZED') {
}
}
```
By changing it to
```ts
onStatusChange?(event: {
cameraStatus: keyof CameraStatus;
recordAudioPermissionStatus: keyof RecordAudioPermissionStatus;
}): void
```
we're able to compare the new status against the intended type, autocomplete, and discard the `any`:
```ts
const handleStatusChange = (event: {cameraStatus: keyof CameraStatus}) => {
if (event.cameraStatus === 'NOT_AUTHORIZED') {
onUnauthorized()
}
}
```
add face detection using mlkit
add enable tracking prop
cleanup android set tracking methods
remove old face detection
fix basic example not building on ios
* added react-navigation
* added barcode scanner example
* exposed barcode bounds and source dimensions in google vision barcode
* updated typescript types for google vision barcode
* feat(rn-camera): add deviceOrientation and videoOrientation to record response.
* feat(rn-camera): add deviceOrientation and pictureOrientation to take-picture-response
* fix(rn-camera): unify orientation handling for recording and takeing picture
* fix(types): adjust typescript types
* docs(rn-camra): document new properties
* fix(android): respect actual boolean value instead of only checking if it is present.
* feat(android): implement orientation prop for takePictureAsync
* feat(android): implement orientation prop for recordVideoAsync
* docs(rn-camera): adjust documentation
* fix(types): unmark properties as ios only
* fix(android): use constants