我尝试使用 QuaggaJS detech code128 条形码,然后继续我的过程。但是我对此有疑问,当我在 Visual Studio 2019 中本地运行我的项目时,调试或发布 mod Nevermind,这是可行的,但是当我在我的删除服务器 192.168.x.yz 上发布项目时,在 iss 和我的 Web 项目上访问这个网址:http://192.168.x.yz:abcd(项目必须在本地网络上访问),在realsed后,我尝试将我的本地网络连接到Android设备,在firefox浏览器上,QuaggaJS LiveStream无法工作。关于 http、localhost 或 https 的问题?当我调试时;错误给出此消息:“getUserMedia 未定义”
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.
}
);