mirror of
https://github.com/serratus/quaggaJS.git
synced 2026-08-13 13:51:37 +08:00
Fixed Events; Added example for multiple types of barcodes
This commit is contained in:
@@ -36,11 +36,12 @@ function initCamera(video, constraints) {
|
||||
.then((stream) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
streamRef = stream;
|
||||
video.src = window.URL.createObjectURL(stream);
|
||||
video.onloadedmetadata = (e) => {
|
||||
video.setAttribute("autoplay", 'true');
|
||||
video.srcObject = stream;
|
||||
video.addEventListener('loadedmetadata', (e) => {
|
||||
video.play();
|
||||
resolve();
|
||||
};
|
||||
});
|
||||
});
|
||||
})
|
||||
.then(waitForVideo.bind(null, video));
|
||||
|
||||
Reference in New Issue
Block a user