Comments (9)
I'm using class component
Tired of trying and trying workarounds, version changes, debugging..
Sure that after the first rendering all works well..
Switch on caveman mode:
added this style in the Camera component:
style={{
...StyleSheet.absoluteFill,
width: Dimensions.get('screen').width,
height: Dimensions.get('screen').height + this.state.update,
}}
and this in componentDidMount:
let context = this;
setTimeout(function () {
context.setState({update: 1});
}, 500);
from react-native-vision-camera.
Did you try 3.9.1? There might be a fix for this issue in there but I have not verified my self. Had same issue on android 10 device
Yes I tried but I got same error
from react-native-vision-camera.
const [hack, doHack] = useState(0);
return (
<Camera
ref={cameraRef}
onInitialized={() => doHack(1)}
style={[StyleSheet.absoluteFill, { width: width + hack }]}
This is working on a functional component 👍 (I've tested on samsung galaxy s10 with Android 10 and Oneplus 7 running Android 12) 🎉
from react-native-vision-camera.
Did you try 3.9.1? There might be a fix for this issue in there but I have not verified my self. Had same issue on android 10 device
from react-native-vision-camera.
from react-native-vision-camera.
const [hack, doHack] = useState(0); return ( <Camera ref={cameraRef} onInitialized={() => doHack(1)} style={[StyleSheet.absoluteFill, { width: width + hack }]}
This is working on a functional component 👍 (I've tested on samsung galaxy s10 with Android 10 and Oneplus 7 running Android 12) 🎉
This worked also for me both for android 11 and android 13 thanks.
from react-native-vision-camera.
const [hack, doHack] = useState(0); return ( <Camera ref={cameraRef} onInitialized={() => doHack(1)} style={[StyleSheet.absoluteFill, { width: width + hack }]}
This is working on a functional component 👍 (I've tested on samsung galaxy s10 with Android 10 and Oneplus 7 running Android 12) 🎉
I covered the component that contains the camera with a condition of a boolean value, but with this trick now the app sometimes crash.
This is the code that call the component:
{cameraVisibile && <ScannerScreen onChangeCameraVisible={onChangeCameraVisible} onQrCheck={onQrCheck} />}
And this is the component of before:
<Camera
codeScanner={codeScanner}
device={device}
isActive={true}
audio={false}
photo={false}
video={false}
onInitialized={() => setHack(1)}
style={[StyleSheet.absoluteFill, {width: Dimensions.get('screen').width + hack}]}
onTouchEnd={() => setEnableOnCodeScanned(true)}
/>
There isn't also a way to disable the camera component without create each time a new component? Or a way to resolve in my way, with an external value?
from react-native-vision-camera.
Duplicate of #2583
from react-native-vision-camera.
the hack is working, I was also facing the same issue. Tq for the help..........
from react-native-vision-camera.
Related Issues (20)
- 🐛 Static background audio noise in the recorded video. HOT 1
- 🐛 V4 No supported surface combination is found when attaching all use-cases HOT 7
- 🐛 I updated my react native version to 0.73.6 my device's back camera and front camera undefined, I have checked it in several android devices all gives the same issue. 💭 HOT 2
- 🐛 takePhoto() generate a fully green image - An unknown error occurred while creating the Camera Session, but the Camera can recover from it HOT 2
- 🐛 Not bound to a valid Camera HOT 2
- 🐛 session/camera-not-ready The Camera is not ready yet! Wait for the onInitialized() callback! HOT 3
- 🐛 Preview stretched / zoomed-in on android HOT 23
- 🔧 CameraDevicesManager.kt: (10, 47): Unresolved reference: RCTDeviceEventEmitter HOT 3
- ✨ chunked recording HOT 7
- 💭 IPhone15 pro max QR code flashing back
- 🐛 Torch stays on after closing the camera HOT 1
- Hi Im using react-native:0.73.6 after capturing photo or video if I try to close the view I have: FATAL EXCEPTION: mrousavy/VisionCamera.main 💭 HOT 2
- 🐛 Error on iOS device while running the react-native-vision-camera example HOT 2
- 🔧 New version "react-native-vision-camera": "^3.9.2" always showing error
- `VisionCamera` does not specify a Swift version and none of the targets (`foobar`) integrating it have the `SWIFT_VERSION` attribute set HOT 1
- ✨ Support export of rawBytes/Data in barcode scanning HOT 2
- 🐛 takePhoto() intermittently failing with [unknown/unknown: Failed to submit capture request] on v4.0.0-beta.10 HOT 1
- Execution failed for task ':react-native-vision-camera:compileDebugKotlin'🔧 HOT 4
- 🐛 photoResolution: 'max' not the same as native camera photo. HOT 9
- 💭 Place text on a frame HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-vision-camera.