fix: support customize camera size

This commit is contained in:
yugasun
2022-05-29 11:23:04 +08:00
parent 7d77236fc0
commit 615081cc95
2 changed files with 21 additions and 4 deletions
+7 -1
View File
@@ -31,7 +31,13 @@
throw new Error('Canvas and getUserMedia are required');
}
let code = await qr.decodeFromCamera(video);
let code = await qr.decodeFromCamera(video,
// you can customize your camera size like below
// {
// width: 400,
// height: 400,
// }
);
console.log('code', code);
result.innerText = 'Result: ' + code.data;
}