jamenamcinteer / react-qr-barcode-scanner

A simple React Component using the client's webcam to read barcodes.
69 stars 71 forks source link

not getting camera permission in android phone #10

Open ahmadkam72 opened 3 years ago

ahmadkam72 commented 3 years ago

err :>> Error: getUserMedia is not implemented in this browser at Object.navigator.mediaDevices.getUserMedia (react-webcam.tsx:29) at sourceSelected (react-webcam.tsx:258) at Webcam.requestUserMedia (react-webcam.tsx:273) at Webcam. (react-hot-loader.development.js:717) at Webcam.componentDidMount (react-webcam.tsx:110) at Webcam. (react-hot-loader.development.js:707) at commitLifeCycles (react-dom.development.js:19814) at commitLayoutEffects (react-dom.development.js:22803) at HTMLUnknownElement.callCallback (react-dom.development.js:188) at Object.invokeGuardedCallbackDev (react-dom.development.js:237) at invokeGuardedCallback (react-dom.development.js:292) at commitRootImpl (react-dom.development.js:22541) at unstable_runWithPriority (scheduler.development.js:653) at runWithPriority$1 (react-dom.development.js:11039) at commitRoot (react-dom.development.js:22381) at finishSyncRender (react-dom.development.js:21807) at performSyncWorkOnRoot (react-dom.development.js:21793) at react-dom.development.js:11089 at unstable_runWithPriority (scheduler.development.js:653) at runWithPriority$1 (react-dom.development.js:11039) at flushSyncCallbackQueueImpl (react-dom.development.js:11084) at flushSyncCallbackQueue (react-dom.development.js:11072) at scheduleUpdateOnFiber (react-dom.development.js:21199) at dispatchAction (react-dom.development.js:15660) at fetchUser (App.js:285)

jamenamcinteer commented 3 years ago

Please make sure that you are using https or localhost. Otherwise, your browser may be outdated and does not support getUserMedia: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#browser_compatibility.

This may be a bug if the error is not being handled gracefully.

ahmadkam72 commented 3 years ago

Hi, I connect my android phone using network to my laptop in order to check it locally, but its not working. Can you help to me to check your library in my phone locally without https? Thank you

On Tue, May 25, 2021 at 9:07 PM Jamena McInteer @.***> wrote:

Please make sure that you are using https or localhost. Otherwise, your browser may be outdated and does not support getUserMedia: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia#browser_compatibility .

This may be a bug if the error is not being handled gracefully.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jamenamcinteer/react-qr-barcode-scanner/issues/10#issuecomment-848036037, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALCUNXWSIADYI3YOD44ZC53TPPG5XANCNFSM45O5KUMA .

sksurendrakmr commented 2 years ago

If you want to check with android devices without deploying the code then in package.json make this below changes and it will start you application in HTTPS mode.

After this change, camera will render in android device.

"scripts":{ ...... "start": "set HTTPS=true&&react-scripts start", ...... ..... }

Then, try to run you application with this url :- https:// your ip address/port