-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera work but overlay is hidden #199
Comments
you need toBack:true |
i tried toBack:true but same issue the overlay is displayed and the camera work but i got white screen |
Hi @marwenhinnaoui and welcome to camera-preview! With I find it easiest to give every element in my app - Good luck! |
Hello, I am having this same problem. I set |
Hello! */ hope this help this |
There's a problem with the plugins implementation for Android. |
@xsh2047 Is there an alternative way it can be implemented on Android? |
I was looking into Ionic Portals. Not sure if this is a valid use case. There's also the Web Media Capture API's but that wouldn't be a native solution. |
Was anyone able to handle this issue on Ionic Angular App? |
No update on that ? |
I'm having the same issue, but only when the app runs in dark mode. If I change the device theme to light - the camera preview shows.
And when I change it in the inspector to red - the black cover does change its color to red, which tells me that the cover is coming from a lower level (OS?) for the dark theme, and not controllable in the app. As a workaround, I'm OK with forcing a light theme in the app:
But it doesn't seem to work. App is now running in Dark mode regardless of theme settings or the above settings. Xiaomi Rednote 8. Is there a way anybody can think of for me to force the light theme on all devices (android and iOS)? |
I was experiencing the white screen with I am using Vue 3 with Ionic 6.1
*Notice |
toBack: true is good solution. thanks. |
Same issue as @xsh2047 descibes it here. On Android, I can either use Using Is there any way to fix this broken behavior? |
Just had this issue myself on Android - if you are in same situation I was (Camera starts, If you have a background colour set within here the preview that shows the camera will be that solid colour rather than the camera feed. Hope this helps others! |
Thanks for the hint, but it didn't fix the issue. The value is already set like you suggested. I also think that this doesn't exactly relate to my problem. I'm using On Android those stacked elements are rendered behind the preview, which leads me to believe, that The Android behavior would be more in line with the documentation, but the desktop behavior is way more useful... Other users commented that iOS behaves like desktop but I wasn't able to verify that yet. |
Facing the same issue in android. Any solutions? |
Facing the same issue here with a Vue3-ts app plugged in to capacitorjs. Web works absolutely fine, I tried multiple approaches all of which worked perfectly on web but the Android issue is persistent exactly as other comments. toBack: false = CameraPreview renders on top of the app, hiding the whole app behind. Was anyone able to solve this? I want a simple camerapreview with the shutter button as overlay. Edit: if this is a known and persistent issue, then it means the captureSample method is now useless, because the only possible use case for it is to analyze what the camera is looking at and provide visual feedback to user, whether a document scan or a AR feature. |
Hi @fawadtariq Added the following to the global.scss file:
And I inject this class into the body of the DOM upon opening the camera: Upon closing the camera, I remove this class: |
getCamera(){
const cameraPreviewOptions: CameraPreviewOptions = {
className:'CameraPreview',
position: 'rear',
x:0,
y:0,
toBack:false,
};
CameraPreview.start(cameraPreviewOptions);
this.cameraActive=true;
}
My scss:
ion-content {
--background: transparent !important;
.CameraPreview{
width: 100%;
height: 10%;
ion-button{
position: absolute;
z-index: 20;
bottom: 0;
}
}
ion-button{
position: absolute;
z-index: 20;
}
}
The text was updated successfully, but these errors were encountered: