Polyfill for BarcodeDetector API
npm install barcode-detector-polyfillNote that currently this polyfill enables detection and decoding of 1D barcodes only, 2D barcodes (EG QR-code) might be added in the future using an additional library.
bower install barcode-detector-polyfill
`Use:
`
`$3
Install:
`
npm install --save barcode-detector-polyfill
`Use:
`
if ('BarcodeDetector' in window) {
continueToStartTheApp();
} else {
require.ensure(['barcode-detector-polyfill'], function(require) {
const BarcodeDetector = require('barcode-detector-polyfill');
window.BarcodeDetector = BarcodeDetector;
continueToStartTheApp();
}, function(err) {
console.log('Failed to load BarcodeDetector', err);
});
}
``See demo