1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| $('#qr-canvas').WebCodeCam({
ReadQRCode: true, // false or true
ReadBarecode: true, // false or true
width: 320,
height: 240,
videoSource: {
id: true, //default Videosource
maxWidth: 640, //max Videosource resolution width
maxHeight: 480 //max Videosource resolution height
},
flipVertical: false, // false or true
flipHorizontal: false, // false or true
zoom: -1, // if zoom = -1, auto zoom for optimal resolution else int
beep: "js/beep.mp3", // string, audio file location
autoBrightnessValue: false, // functional when value autoBrightnessValue is int
brightness: 0, // int
grayScale: false, // false or true
contrast: 0, // int
threshold: 0, // int
sharpness: [], //or matrix, example for sharpness -> [0, -1, 0, -1, 5, -1, 0, -1, 0]
resultFunction: function(resText, lastImageSrc) {
/* resText as decoded code, lastImageSrc as image source
example:
alert(resText);
*/
},
getUserMediaError: function() {
/* callback funtion to getUserMediaError
example:
alert('Sorry, the browser you are using doesn\'t support getUserMedia');
*/
},
cameraError: function(error) {
/* callback funtion to cameraError,
example:
var p, message = 'Error detected with the following parameters:\n';
for (p in error) {
message += p + ': ' + error[p] + '\n';
}
alert(message);
*/
}
}); |
Partager