mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 05:31:37 +08:00
video working
This commit is contained in:
committed by
Christoph Oberhofer
parent
f8bc6a705c
commit
f1a963f4a0
+17
-17
@@ -2,6 +2,10 @@ console.log(typeof Quagga);
|
||||
|
||||
|
||||
// creates a new instance!
|
||||
var code128Scanner = Quagga
|
||||
.decoder({readers: ['code_128_reader']})
|
||||
.locator({patchSize: 'medium'});
|
||||
|
||||
var eanScanner = Quagga
|
||||
.decoder({readers: ['ean_reader']})
|
||||
.locator({patchSize: 'medium'});
|
||||
@@ -10,7 +14,7 @@ var i2of5Scanner = Quagga
|
||||
.decoder({readers: ['i2of5_reader']})
|
||||
.locator({patchSize: 'small', halfSample: false});
|
||||
|
||||
eanScanner
|
||||
/*eanScanner
|
||||
.fromImage('../test/fixtures/ean/image-001.jpg', {size: 640})
|
||||
.toPromise().then((result) => {
|
||||
console.log(result.codeResult.code);
|
||||
@@ -25,7 +29,7 @@ i2of5Scanner
|
||||
}).catch(() => {
|
||||
console.log("ITF not found!");
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
/* imageReader.addEventListener('processed', (result) => {
|
||||
console.log(result);
|
||||
@@ -42,18 +46,14 @@ i2of5Scanner
|
||||
console.log(result.codeResult.code);
|
||||
});*/
|
||||
|
||||
/*var videoScanner = myReader.fromVideo({
|
||||
constraints: {
|
||||
width: 640,
|
||||
height: 480,
|
||||
facingMode: "environment"
|
||||
}
|
||||
});
|
||||
|
||||
videoScanner.addEventListener('detected', (result) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
videoScanner.then((result) => {
|
||||
console.log(result);
|
||||
}); */
|
||||
code128Scanner
|
||||
.fromVideo({
|
||||
constraints: {
|
||||
width: 1280,
|
||||
height: 720,
|
||||
facingMode: "environment"
|
||||
}
|
||||
})
|
||||
.addEventListener('detected', (result) => {
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user