Capacitor Camera Preview Issue: iPhone camera started in live mode. It should start as camera not live mode
sandeepsharma2487 opened this issue · 0 comments
I have used Capacitor Camera Preview for Android and iOS Application. Below are the code
import { CameraPreviewOptions, CameraPreviewPictureOptions } from '@capacitor-community/camera-preview';
import { Plugins } from "@capacitor/core";
const { CameraPreview } = Plugins;
To Start Camera Feature
const cameraPreviewOptions: CameraPreviewOptions = {
position: 'rear', // front or rear
parent: 'content', // the id on the ion-content
toBack: false
};
CameraPreview.start(cameraPreviewOptions);
Take Picture Method
const cameraPreviewPictureOptions: CameraPreviewPictureOptions = {
quality: this.imageQuality,
// width: window.innerWidth, //width of the camera display
// height: window.innerHeight, //height of the camera
};
const result = await CameraPreview.capture(cameraPreviewPictureOptions);
let tempImage = data:image/jpeg;base64,${result.value}
;
Flip Camera
CameraPreview.flip();
For Android Flip feature not working I'm using android 11 of later.
package.json File contains
dependencies
"@angular/core": "^14.0.0",
"@angular/platform-browser": "^14.0.0",
"@angular/platform-browser-dynamic": "^14.0.0",
"@capacitor-community/camera-preview": "^4.0.0",
"@capacitor/android": "^4.3.0",
"@capacitor/core": "^4.3.0",
devDependencies
"@angular/cli": "^14.0.0",
"@angular/compiler": "^14.0.0",
"@angular/compiler-cli": "^14.0.0",
To Reproduce
Steps to reproduce the behavior:
Open the camera of iPhone, It getting started in live mode not normal camera mode
Expected behavior
I have added custom template for camera feature, that should come over the camera (Ref: first image Expected behavior) , that is working fine for Android 11 or later but in case of iOS live camera started in place of camera, I have turned off live camera from setting as well. It may be the default behavior of the iOS camera but is there any way that we can start normal camera in place of live broadcasting camera feature.
Flip camera should work for android platform version 11 later
Screenshots
Expected Behavior with below camera and cancel icon
Current Behaviour hidden button because of live camera started live camera started, if we cancel live camera the camera stopped.
Smartphone (please complete the following information):
- Device: [iPhone XR]
- OS: [e.g. iOS 15.5]
- Browser [safari]
Additional context
I do follow that link to implement camera feature.
https://github.com/capacitor-community/camera-preview
Suggest me how to handle iOS feature live camera feature, If you have any running example please share that.
Thanks