#47: Passing camera related errors to the init callback

This commit is contained in:
Christoph Oberhofer
2015-07-06 22:47:11 +02:00
parent 8ad97419c3
commit 2c61d16cb7
8 changed files with 124 additions and 49 deletions
+9 -1
View File
@@ -11,12 +11,20 @@ $(function() {
});
var App = {
init : function() {
Quagga.init(this.state, function() {
var self = this;
Quagga.init(this.state, function(err) {
if (err) {
return self.handleError(err);
}
Quagga.registerResultCollector(resultCollector);
App.attachListeners();
Quagga.start();
});
},
handleError: function(err) {
console.log(err);
},
attachListeners: function() {
var self = this;