Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

still not work on android and ios #46

Open
Alphonse99 opened this issue Sep 4, 2016 · 12 comments
Open

still not work on android and ios #46

Alphonse99 opened this issue Sep 4, 2016 · 12 comments

Comments

@Alphonse99
Copy link

how can i fix it

@sthag
Copy link

sthag commented Sep 13, 2016

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?

@danieleds
Copy link

@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
Copy link

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

https://webqr.com/

@sthag
Copy link

sthag commented Sep 23, 2016

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

@Fever905
Copy link

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

@Fever905
Copy link

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

@nuthinking
Copy link

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.

@Alexstraza
Copy link

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?

@sthag
Copy link

sthag commented Oct 24, 2016

@Alexstraza You can add the autoplay attribute to the video element within the source code like danieleds mentioned before #46 (comment) This worked for me.

@Alexstraza
Copy link

@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;.

@PierreTrp
Copy link

PierreTrp commented Oct 28, 2016

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/

@MCodyB
Copy link

MCodyB commented Nov 3, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants