html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

still not work on android and ios

Open Alphonse99 opened this issue 8 years ago • 12 comments

how can i fix it

Alphonse99 avatar Sep 04 '16 05:09 Alphonse99

I also have the problem that the code is working fine on desktop chrome 52 for example. But on Android 6 with Chrome 52 the camera feed is displayed but freezes after one second. The feed continues if the html element containing the video source is touched and moved permanently. As long as there is movement the video feed is updated. Without interaction the video stops.

Is there a solution to this problem?

sthag avatar Sep 13 '16 16:09 sthag

@sthag about that problem, I fixed it by adding the 'autoplay' attribute to the video element here: https://github.com/dwa012/html5-qrcode/blob/e9f06a7/src/html5-qrcode.js#L18

danieleds avatar Sep 19 '16 18:09 danieleds

By the way, it might be useful to look at the source code of the upstream library's demo webpage:

https://webqr.com/

danieleds avatar Sep 19 '16 18:09 danieleds

Thanks @danieleds for pointing out the autoplay issue. Maybe I have the time for a pull request in the future.

sthag avatar Sep 23 '16 12:09 sthag

The autoplay element didn't help on Android 7 (Nexus 6P) .. video only refreshes when i scroll the page up/down a little.

Fever905 avatar Sep 23 '16 17:09 Fever905

Curious too, https://webqr.com/ doesn't work for me in Chrome (windows 7)

Fever905 avatar Sep 23 '16 17:09 Fever905

All camera demos I checked online don't seem to work on mobile. All the qr code demos instead don't work either on mobile nor on desktop with Chrome 53.

nuthinking avatar Sep 29 '16 09:09 nuthinking

I'm using this library for a mobile webapp but the camera freezes unless I constantly move the page around with my finger. How can I make sure that the camera feed is constantly being updated so I don't have to constantly move the page around?

Alexstraza avatar Oct 24 '16 07:10 Alexstraza

@Alexstraza You can add the autoplay attribute to the video element within the source code like danieleds mentioned before https://github.com/dwa012/html5-qrcode/issues/46#issuecomment-248078349 This worked for me.

sthag avatar Oct 24 '16 18:10 sthag

@sthag Thanks! It worked!

For people still struggling, just add

video.setAttribute('autoplay',''); under line 25, which would be under var video = vidElem[0]; var canvas = canvasElem[0]; var context = canvas.getContext('2d'); var localMediaStream;.

Alexstraza avatar Oct 26 '16 07:10 Alexstraza

only works on MAC (even with the fix mentioned above)

Tried on an iphone 9.3 (safari & firefox) and also on my laptop (windows 7) on firefox and chrome and both are not working (for laptop : nothing show on your example page or on my fiddle and for iphone, it show a play button but nothing happens when i click)

https://jsfiddle.net/5yrj1zz2/3/

PierreTrp avatar Oct 28 '16 10:10 PierreTrp

@PierreTrp I don't think it will work on an iPhone period because it doesn't allow the browser to access the camera

MCodyB avatar Nov 03 '16 02:11 MCodyB