Coder Social home page Coder Social logo

Comments (14)

MaicolBen avatar MaicolBen commented on August 28, 2024

+1

In iOS you can switch the camera side, but in Android you can't

from phonegap-plugin-barcodescanner.

piotrkubisa avatar piotrkubisa commented on August 28, 2024

It is camera and android specific quirk. Of course you can change which camera should be used via JS, and then also barcode scanner:

cameraDirection property is used to set the camera direction(front/back). You have to add it in the options like this:

navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50, cameraDirection:1, destinationType:        destinationType.DATA_URL}); } 

"1" is used for front-facing camera and "2" is used for back-facing camera.
via http://stackoverflow.com/questions/17021601/phonegap-cordova-front-facing-camera-by-default-in-android

But, but...

"Any cameraDirection value results in a back-facing photo."
via http://docs.phonegap.com/en/3.1.0/cordova_camera_camera.md.html#cameraOptions_android_quirks

from phonegap-plugin-barcodescanner.

bobalazek avatar bobalazek commented on August 28, 2024

You are talking about the camera plugin...

The barcodescanner plugin does not accept any options / config as I'm concerned, or does it?
At least I can't find any documentation, that the .scan method would accept options.

from phonegap-plugin-barcodescanner.

convey-mane avatar convey-mane commented on August 28, 2024

As far as we are talking about the iOS side, take a look at #97 😉

from phonegap-plugin-barcodescanner.

MaicolBen avatar MaicolBen commented on August 28, 2024

@convey-mane #97 adds Android front camera support? seems to me iOS improvements

from phonegap-plugin-barcodescanner.

convey-mane avatar convey-mane commented on August 28, 2024

@MaicolBen That's exactly why I wrote

As far as we are talking about the iOS side

The original poster didn't mention any OS, so … just to be sure 😉
But on iOS, you were right, switching cameras is already possible without my extensions – just added the right icon. Sorry for that!

from phonegap-plugin-barcodescanner.

bobalazek avatar bobalazek commented on August 28, 2024

Indeed, I was also more thinking about android.

Otherwise, I wasn't talking about the camera plugin, but the barcode plugin (which doesn't accept any options; so the camera options are not really helpfull).

from phonegap-plugin-barcodescanner.

MaicolBen avatar MaicolBen commented on August 28, 2024

@convey-mane 👍

from phonegap-plugin-barcodescanner.

mlemainque avatar mlemainque commented on August 28, 2024

Did anybody find a way to use front camera ?

from phonegap-plugin-barcodescanner.

inzi avatar inzi commented on August 28, 2024

Is there a way to disable camera flipping in the barcode scanner plugin?

from phonegap-plugin-barcodescanner.

EddyVerbruggen avatar EddyVerbruggen commented on August 28, 2024

Note that in the latest ZXing library release a feature was added to specify the camera id. So once this is updated it's easy to pass it in to Android as well.

from phonegap-plugin-barcodescanner.

dohoangn avatar dohoangn commented on August 28, 2024

To Remove camera flipping in iOS, open CDVBarcodeScanner.mm.
Remove everything associated with flipCamera in CDVBarcodeScanner.mm

from phonegap-plugin-barcodescanner.

inzi avatar inzi commented on August 28, 2024

Thank you! I ended up commenting it out and doing pretty much just that.

I have yet to get a custom XIB to work - but for now that's working.

from phonegap-plugin-barcodescanner.

lock avatar lock commented on August 28, 2024

This thread has been automatically locked.

from phonegap-plugin-barcodescanner.

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.