I use angular 6 with the latest version of this library. I tried on several popular browsers with latest versions too, but no video camera shows up like in the demo. I inspected the element and below video element, it shows the texts 'Your browser does not support this feature, please upgrade it.'.
Here is the screenshot: https://imgur.com/a/fRiuzdk
Does the demo works with the same browsers you tested?
Yes, I meant the demo works fine, but when integrating into my angular app, the camera does not show. Do you know what the root cause is?
In your print I can see autoplay set to false, so I think that's the cause, you gotta start the camera stream / scanner by yourself.
'Your browser does not support this feature, please upgrade it.'.
This is a text shown in the rendered document when the browser dosn't supports the video tag, written by ourselves. You just found it in the source, there's nothing wrong.
I will close as this isnot a bug, but I'm still able to help.
But in your demo, camera still plays and I checked the video element that is : <video class="customClass" autoplay="false" muted="true" playsinline="true" autofocus="true"></video>
All right, please try to download the demo and execute it locally.
I just tried, then it threw an error: formats.map is not a function
at ZXingScannerComponent.set [as formats] (zxing-scanner.component.ts:91). Then I removed this line, it works. Can please you explain why?
I think it is something with your local development environment, the same source is building fine at Travis and on my machine. 馃
Ah, formats.map is a way to discover/create hints to the decoder to increase decoding speed and chances to get a successful scan.
Yes, you are probably right, I tried on another machine, it works well. Thank you so much for your help
You are welcome, get in touch if something else happens, and feel free to join us on Gitter.
Hi, I experience the same problem (Angular6). Did someone find a way to fix that problem?
Please, provide OS, Browser and library verions.
Version: "@zxing/ngx-scanner": "^1.2.1",
OS: MacOS
Browser: Chrome / Firefox / Safari, each latest version
MacOS version? Can you provide a print screen too?
High Sierra, 10.13.6.

Please take a look at https://github.com/zxing-js/ngx-scanner/issues/125#issuecomment-410540442 I think it's the same case.
Update: Silly me, all what I need was a good ol' reboot.
--------------------------------------------------------
Hello.
Suddenly not a single app that uses camera works under Chrome 69.0.3497.100 in MacOS 10.13.6 (my setup). I've tried a bunch of random websites that uses the camera and not a single one works:
https://hangouts.google.com
https://web.whatsapp.com/
https://webrtc.github.io/samples/src/content/getusermedia/gum/ ("official" test)
Here is the live demo from this repo -- same result :(
https://zxing-ngx-scanner.stackblitz.io/
No error from console, no HTMLElement.onloadedmetadata event fired, no nothing into <video>.
Maybe something has been updated and broken for good, but not in this repo.
Note: Safari is not working either.
Cheers.
Working on Chrome 71.0.3558.0 and 71.0.3560.0 and MacOS 10.13.6. Safari is working fine btw. We can investigate this if you want, but we should go to another issue to discuss that, since this issue here has nothing to do with the real possible problem.
Working now. Please check if your computer is not up for like a month like mine was. A stupid reboot and all working now. Rookie basics...
@odahcam sorry for wasting your time, and thanks for your help. Case closed for me.
I keep having this issue in both chrome (Version 71.0.3578.80 (Official Build) (64-bit)
) and firefox. I see camera LED on my laptop blink once when page loads but that is it. at first I thought it was because of Angular7 but I get the same thing with Angular6. Running on Linux.
I am trying to move from AngularJS where my scanner works fine so I believe it is not issue with my laptop. Am I missing something?
None of the demos work for me but they do not even get as far as to even try the camera
So it is nice I got as far as having the video element placed to DOM but how do I make it work?
Damn, I'm definitely not happy with these examples. Have you tried to clone the repo and ng serve it?
Also, StackBlitz is VERY slow, but it is working after some time of loading.
npm install fails with this
npm ERR! file /home/.../ngx-scanner/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token } in JSON at position 3375 while parsing near '...nner"
npm ERR! JSON.parse }
npm ERR! JSON.parse }
npm ERR! JSON.parse }
npm ERR! JSON.parse '
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
Also, StackBlitz is VERY slow, but it is working after some time of loading.
OK cool it loaded now I tried several times before so I guess it woke up from swap and works now! It behaves exactly the same as my app. It loads, LED blinks BUT manually selecting the camera from the drop-down loads it fine. So it was just me not setting the device because I assumed it will work out of the box. Should be simple to auto-select first camera. Thanks!!
In future versions it will autoselect the first available camera, I disabled it by mistake some time ago and it stayed like that. Thanks for your patience.
sorry for bugging you, hopefully it will help someone :) once the demo got working it was easy to understand what is wrong but without it I was clueless
Yeah, I wanna fix the demo with #150, that's very needed.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.