This repository has been archived by the owner on Jun 16, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ios): Add cameraId feature to iOS and various bug fixes (#2510)
* 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.
- Loading branch information