first code ————————————–
“””
barcode
Barcode: …
let image = new Image();
image.crossOrigin = “Anonymous”;
image.src = “https://finlandbarcodes.com/wp-content/uploads/sites/197/2013/09/07-EAN-13-Standard-300×196.jpg”;
image.onload = function () {
javascriptBarcodeReader({
image: image,
barcode: “ean-13”
// barcodeType: “interleaved”
})
.then((result) => {
document.getElementById(“barcode-title”).innerHTML = result;
})
.catch(console.log);
}
“””
second code ———————————
"""
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>cam</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.1.9/p5.js"></script>
</head>
<body>
<script>
let cam;
function setup() {
createCanvas(400, 300);
cam = createCapture(VIDEO);
cam.size(400, 300);
cam.hide();
}
function draw() {
image(cam, 0, 0);
}
</script>
</body>
</html>
"""
**first code was https://www.npmjs.com/package/javascript-barcode-reader**
*second code was p5js*
*I'd like to combine two codes.*
