mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-12 21:21:42 +08:00
#47: Passing camera related errors to the init callback
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user