- Real device with working camera
Starts the camera preview instance with the settings specified by Camera Preview Options. By default it opens a square camera with a size equivalent to the screen width minus some padding.
Stops the camera preview instance.
Switch between the rear camera and front camera, if available.
Take the picture using either the selected or the default resolution.
The reason behind this inconsistency between devices is unknown. If you happen to have info about this, kindly leave a comment with your findings. This problem does not apply when taking photo with a square resolution, or when using the takeSnapshot method.
Take snapshot of the camera preview.
The resulting image will be the same size as specified in startCamera options. I could not verify this last statement in demo app. What I did verify instead was this:
|Device||startCamera size||takeSnapshot size|
|Sony Xperia XZ1||320×320||1080×1920|
|Xiaomi Redmi 9||320×320||1080×1080|
The demo app always crops the resulting picture as expected when using takeSnapshot as long as the camera preview was started with a 1:1 ratio.
Hide the camera preview box.
Show the camera preview box.
Change the size of the preview window. Size must be a valid preview resolution which the plugin does not yet retrieve.
Populate the camera sizes select box with the retrieved modes. The takePicture method will use the selected size.
Populate the flash modes select box with the retrieved modes.
Puplate the focus modes select box with the retrieved modes.
Puplate the color effects select box with the retrieved effects.
Populate the zoom select box with values ranging from 1 to the retrieved maxZoom.
The demo app shows two pictures for each invocation of the takePicture and takeSnapshot methods as follows:
- Full picture taken using the requested method. May seem “cropped” when compared to default preview depending on the chosen camera size.
Download demo app
Use the comments section here for demo app-related issues, and the GitHub issues tracker for plugin-related ones.