JsQRScanner icon indicating copy to clipboard operation
JsQRScanner copied to clipboard

QR code scanner doesn't work on Chrome on iPhone

Open arahant opened this issue 5 years ago • 21 comments

Error: (TypeError) : undefined is not a function (near '...MediaStreamTrack.getSources...')

arahant avatar Nov 06 '19 02:11 arahant

Same problem over here.

frederichoule avatar Dec 05 '19 02:12 frederichoule

Same problem for me. Also not working on firefox.

Any solutions?

nan4k7 avatar Jan 22 '20 22:01 nan4k7

same problem on Safari and chrome on android. any help ?

Msameim181 avatar Feb 26 '20 14:02 Msameim181

Few weeks ago we tested the scanner on Chrome in iOS and it worked, which caused us to develop a scanner solution using this API, but today when my client tested it on his ios devices it did not recognize the camera! The attached picture shows that the same error as reported in this thread was thrown when i asked my client to check the demo page.

Please advise. Thanks a lot. WhatsApp Image 2020-02-28 at 02 13 30

ilanmazuz avatar Feb 28 '20 00:02 ilanmazuz

same problem on Safari and chrome on android. any help ?

Thats wierd, for us there are no problems on android/chrome not on ios/safari.

ilanmazuz avatar Feb 28 '20 00:02 ilanmazuz

getSources was removed in 08c4c1968787fcad2811afcacf40fabed1123fd6 I updated the live demo to use the latest source.

jbialobr avatar Feb 28 '20 07:02 jbialobr

Your live demo is good on any device, but i have problem still. i updated the source now, and the previous problem fixed but another problem showed up. This is the screenshot. on Chrome iPhone IMG_8299

on Safari iPhone: IMG_8300

on chrome android: Screenshot_20200228_114657_com android chrome

Please advise. Thanks a lot.

Msameim181 avatar Feb 28 '20 08:02 Msameim181

same problem on Safari and chrome on android. any help ?

Thats wierd, for us there are no problems on android/chrome not on ios/safari.

I dont know why but :(.

Msameim181 avatar Feb 28 '20 08:02 Msameim181

getSources was removed in 08c4c19 I updated the live demo to use the latest source.

Dear Janusz,

your live demo is working, but I have same problem can't work when put your source code on my web server?

https://passport.tapbee.city/gate/qrtest.html

did I miss any thing on that?

jolioslin avatar Mar 02 '20 07:03 jolioslin

@jolioslin

It works on my desktop and mobile devices: image

I don't know why it is not working on yours. You should try to debug the reason with your browser DevTools. It might be easier using the second exmaple (Providing a video stream in a custom way) from https://github.com/jbialobr/JsQRScanner

jbialobr avatar Mar 02 '20 11:03 jbialobr

Hi @jolioslin, Did you test on iOS with Chrome?

Cause for myself on the desktop and Android its working fine, but my cleint use iOS/Chrome and for him it stopped working recantly and shows the black picture with the No Cam sign i posted earlier.

p.s. i asked my client to test the second demo and i will update once he does.

Thanks a lot, ilan.

ilanmazuz avatar Mar 02 '20 11:03 ilanmazuz

@ilanmazuz

here is the test , both iphone6 and iPhone 11 with chrome are not work.

iphone6/ios12.4.5/chrome 80.0.3907.95

iphone6_ios12_4_5_chrome_80_0_3907_95

iphone11/ios13.3.3.1/chrome 80.0.3907.95 iphone11_ios_13_3_3_1_chrome_80_0_3907_95

but all works fine on both iphone6 and iphone11 safari.

jolioslin avatar Mar 02 '20 13:03 jolioslin

@ilanmazuz

here is the test , both iphone6 and iPhone 11 with chrome are not work.

iphone6/ios12.4.5/chrome 80.0.3907.95

iphone6_ios12_4_5_chrome_80_0_3907_95

iphone11/ios13.3.3.1/chrome 80.0.3907.95 iphone11_ios_13_3_3_1_chrome_80_0_3907_95

but all works fine on both iphone6 and iphone11 safari.

I’ve got this exact same problem. Also not working on Firefox for iOS

nan4k7 avatar Mar 02 '20 13:03 nan4k7

@jolioslin, i know it works on Safari - thats what i said from the beginig, but my clients prefer to use Chrome on thier iOS devices and it used to work for them just couple of weeks ago.

Are you planing on fixing it to work on ios+chrome?

Thanks a lot.

ilanmazuz avatar Mar 02 '20 16:03 ilanmazuz

Hi again @jolioslin, Its been few crazy months for all of us and i hope that you and your loved ones are safe.

From what i read online, it seems that the problem is with Apple policy of blocking all non Safari browsres from accessing the camera. Do you know of any workaround or any fix that will be applied any time soon?

Please let us know if there is any update on this maater.

Thanks a lot, ilan.

ilanmazuz avatar May 27 '20 11:05 ilanmazuz

For Security reasons every modern web browser blocks request to camera and microphone unless it is from a valid https source.

ohbus avatar Sep 02 '20 19:09 ohbus

For Security reasons every modern web browser blocks request to camera and microphone unless it is from a valid https source.

This may refer to #28. AFAIK modern web browsers will throw an exception or dump a message to the console in this case. This is obviously suppressed by JSQRScanner, which makes it intransparent. Reading through the issues I get the impression that I'm not the only developer who got caught in this trap.

erotte avatar Sep 30 '20 08:09 erotte

Still not ok on iOS / Chrome: https://github.com/jbialobr/JsQRScanner/issues/28#issuecomment-703114073

clauderobi avatar Oct 03 '20 14:10 clauderobi

Still not ok on iOS / Chrome I checked in ipad on live demo

agoalofalife avatar Nov 05 '20 15:11 agoalofalife

@jbialobr @clauderobi @agoalofalife @ilanmazuz @jolioslin Any status on this?

RileyIsOnGitHub avatar Dec 14 '21 22:12 RileyIsOnGitHub

I am using react so I switch to another reader. I am using blackbox-vision/react-qr-reader instead.

clauderobi avatar Jan 04 '22 18:01 clauderobi