Fixed Events; Added example for multiple types of barcodes

This commit is contained in:
Christoph Oberhofer
2016-05-26 23:54:59 +02:00
parent be70d72e0b
commit 2f2ed46cf3
16 changed files with 2444 additions and 1561 deletions
+4 -3
View File
@@ -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));