Q:

Cordova BarcodeScanner continuous reading

I'm using MeteorJs and Cordova with the Barcodescanner plugin.
I need to do multiple reads of different qrcodes, and send every read to a remote server. 
With this code I can make one read and then Cordova closes the camera (for make a new one I need to recall the code).  
cordova.plugins.barcodeScanner.scan(
    function(result) {
        Meteor.call('newQR', result.text);
    },
    function(error) {
        alert("Scanning failed: " + error);
    }
);

How can I make mutiple and continuous readings (without exiting from the camera reader)?
Thanks.

A:

You could try something like:
function scanBarcode() {
    cordova.plugins.barcodeScanner.scan(
        function(result) {
            Meteor.call('newQR', result.text);
            if( !result.cancelled ) {
                scanBarcode();
            }
        },
        function(error) {
            alert("Scanning failed: " + error);
        }
    );
}
scanBarcode();

