简体   繁体   中英

React Camera component does not work on mobile device

I'm trying to test the Camera component on my react application using mobile devices (I tried with iPad pro and Google pixel 6a). I tried react-webcam and react-camera-pro , but neither works on mobile devices for some reason. (I used Google Chrome for the browser) For react-camera-pro, it gives me noCameraAccessible error, which clearly should not be true. I believe the problem is not related to permission because I can open the demo for react-camera-pro, and the camera works perfectly fine. Has anyone experienced similar problems? If anyone knows the solution, can you please share the knowledge? Thank you.

in testing environment you need to add HTTPS=true to your start script in package.json ,ie "HTTPS=true react-scripts start"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM