tjieco / cordova-plugin-barcodescanner-browser-support Goto Github PK
View Code? Open in Web Editor NEWThis project forked from phonegap/phonegap-plugin-barcodescanner
cross-platform BarcodeScanner for Cordova / PhoneGap
License: MIT License
This project forked from phonegap/phonegap-plugin-barcodescanner
cross-platform BarcodeScanner for Cordova / PhoneGap
License: MIT License
This could be either done in the plugin or in the ZXing TS port. Not sure which, but for now it's an open issue.
Looking at the code, it assumes that device id 0 is the back-camera. However on my phone (Samsung Galaxy S10) it is different:
[{"deviceId":"17e5a41bbe3c7c3e48e78bf8aaa34e4b9dbfc0c79ff6b366220c90c10c906f6a",
"label":"camera2 1, facing front"},{"deviceId":"70c376f23218bb2a6692ac2950346140
4bb833608cb2753c169998f016a1c0be","label":"camera2 3, facing front"},{"deviceId"
:"2b792a7806ebbd3ccd6f726e80aec22c2e950514b9d546b012a27a8241e43fc3","label":"cam
era2 2, facing back"},{"deviceId":"56615a90c09f59fc7ebaccf1a1139c3b178c2655429dc
2938a4dbe33b668e981","label":"camera2 0, facing back"}]
Now it would be possible to set this by adding an input field "barcodeScanDevice".
However the code reads it like this:
deviceId = document.getElementById("barcodeScanDevice");
Which returns an HTML element instead of the value of the actual textbox. function startScan(deviceId, assumes deviceId is an int, but here it is not an int.
This is done by adding video element args to the scan() method so you can rename your video element to any ID you want instead of barcodeScanStream.
Getting error manifest merger
These lines are added when I add the barcode plugin, and cordova build fails. But when these line are commented it is working fine.
<!--<activity android:clearTaskOnLaunch="true" android:configChanges="orientation|keyboardHidden|screenSize" android:exported="false" android:name="com.google.zxing.client.android.CaptureActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden" />-->
<!--<activity android:label="Share" android:name="com.google.zxing.client.android.encode.EncodeActivity" />-->
I have 2 plugins
-- Barcode scanner
-- Camera plugin
Android 6.0 +
cordova --version
8.1.2 ([email protected])
cordova platforms
android 7.1.4
cordova plugin version | grep phonegap-plugin-barcodescanner
phonegap-plugin-barcodescanner 7.1.22 "BarcodeScanner"
Element activity#com.google.zxing.client.android.CaptureActivity at AndroidManifest.xml:89:9-311 duplicated with element declared at AndroidManifest.xml:21:9-26:20
AppName/platforms/android/app/src/main/AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.