Code Monkey home page Code Monkey logo

Comments (10)

odahcam avatar odahcam commented on August 10, 2024 2

Again, I want the same as you, so I created a method called chooseDevice, which is available in 1.0.0-dev.

And again, I'll post updates soon :)

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024 1

Yes, it's now changeDevice.

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

Basically you will be able to see all available videoinputdevices and iterate'em, so you will need to check if that item is the camera you want, if it is, just call NgxZxingComponent.chooseDevice and pass the choosen device to the method. (the names can differ from the latest version)

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

Fixed in #28.

You can use the dev version, which should be more stable than 0.3.x.

from ngx-scanner.

fletchsod-developer avatar fletchsod-developer commented on August 10, 2024

Did this changes get checked in to NPM package, @zxing/ngx-scanner which is now version 1.3.0 ?

I'm not seeing the NgxZxingComponent.chooseDevice method.

from ngx-scanner.

jaysella avatar jaysella commented on August 10, 2024

@odahcam Is this still accurate? With changeDevice I am now getting "Property 'changeDevice' does not exist on type 'ZXingScannerComponent'."

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

Just set scanner.device = myDevice or bind it like <zxing-scanner [device]="myDevice" />.

from ngx-scanner.

jaysella avatar jaysella commented on August 10, 2024

OK, thank you - I have been able to implement it using [device]. Perhaps the reference to changeDevice() should be removed from the StackBlitz in the future to avoid confusion since [(device)]="currentDevice" is already implemented there?

from ngx-scanner.

dejooo13 avatar dejooo13 commented on August 10, 2024

I get this same issue, and when i remove of "Property 'changeDevice' does not exist on type 'ZXingScannerComponent'." and this is my

<zxing-scanner #scanner [scannerEnabled]="scannerEnabled" [device]="currentDevice" (scanSuccess)="handleQrCodeResult($event)" [formats]="['QR_CODE', 'EAN_13', 'CODE_128', 'DATA_MATRIX']"></zxing-scanner>

when i remove changeDevice i get this Can't bind to 'scannerEnabled' since it isn't a known property of 'zxing-scanner'. and then when i remove even that from the code i get "The device must be a valid MediaDeviceInfo or null."

from ngx-scanner.

odahcam avatar odahcam commented on August 10, 2024

The APIs changed, scannerEnabled is now enable and the change or choose device does not exists anymore. Just bind to the [device]="myDevice" and change it as you want.

from ngx-scanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.