cljsrn

muje hoxe 2022-08-11T08:51:49.165279Z

any guide on accessing the camera?

joshmiller 2022-08-11T16:28:28.518359Z

You should be able to just use one of the normal RN libraries from CLJS relatively easily. Either in Expo, or with a lib like https://github.com/mrousavy/react-native-vision-camera

👍 1
muje hoxe 2022-08-11T21:17:21.464709Z

LOG Running "AwesomeProject" with {"rootTag":1} ERROR TypeError: undefined is not an object (evaluating 'device.id') here is the gist of the code (defn cam [] (let [devices (rnvc/useCameraDevices) device (. devices -back)] [:> rnvc/Camera {:device device :is-active true :style (. rn/StyleSheet -absoluteFill)}])) (defn root [] [:> rn/View {:style (.-container styles)} [:> rn/Text {:style (.-title styles)} "Hello!"] [:f> cam]])

muje hoxe 2022-08-11T21:17:47.020389Z

using https://github.com/mrousavy/react-native-vision-camera

muje hoxe 2022-08-11T21:18:03.760569Z

can anyone help me with that

muje hoxe 2022-08-11T21:23:44.650269Z

i think i should await for the camera permission request, now trying to translate the js code

joshmiller 2022-08-11T23:38:12.020469Z

Yeah, from a quick look at the guide, you have to await Camera.requestCameraPermission(). I think if you just put your view behind an (if device ...) with a fallback loading/whatever screen, you’ll be fine.