QuaggaJS http issue

456 Views Asked by At

I tried to using QuaggaJS detech code128 barcode and then continue my process. But I have issue about this, when I running my project locally in visual studio 2019, debug or relase mod nevermind, that works, but when I published project on my remove server 192.168.x.yz, in iss and my web project accessed on this url: http : / / 192.168.x.yz:abcd (Project must be accessed on just local network) , after realsed, I tried to my local network connected Android device, on firefox browser, QuaggaJS LiveStream couldnt work. Is issue about http, localhost or https ? When I debugging; Error give this message : "getUserMedia is not defined"

 var liveStreamConfig =
        {
            inputStream: {
                type: "LiveStream",
                constraints: {
                    width: { min: 640, max: 640 },
                    height: { min: 480, max: 480 },
                    aspectRatio: { min: 1, max: 100 },
                    facingMode: "environment" // or "user" for the front camera
                }
            },
            locator: {
                patchSize: "medium",
                halfSample: true
            },
            numOfWorkers: (navigator.hardwareConcurrency ? navigator.hardwareConcurrency : 4),
            decoder: {
                "readers": [
                    { "format": "code_128_reader", "config": {} },
                    { "format": "ean_reader", "config": {} },
                    { "format": "ean_2_reader", "config": {} },
                    { "format": "ean_5_reader", "config": {} },
                    { "format": "ean_8_reader", "config": {} },
                    { "format": "upc_reader", "config": {} },
                    { "format": "upc_e_reader", "config": {} }
                ]
            },
            locate: true
        };

Quagga.init(
  liveStreamConfig,
  function(err){  //err: Error: getUserMedia is not defined
  //when livestream give error UI display message and directive to manually adding files.
}
);
0

There are 0 best solutions below