pull/259/merge
Gregory Benner 6 years ago committed by GitHub
commit 06b950a54d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

110
dist/quagga.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -23,7 +23,7 @@ function waitForVideo(video) {
window.setTimeout(checkVideo, 500); window.setTimeout(checkVideo, 500);
} }
} else { } else {
reject('Unable to play video stream. Is webcam working?'); reject(new Error('Unable to play video stream. Is webcam working?'));
} }
attempts--; attempts--;
} }
@ -40,15 +40,14 @@ function waitForVideo(video) {
function initCamera(video, constraints) { function initCamera(video, constraints) {
return getUserMedia(constraints) return getUserMedia(constraints)
.then((stream) => { .then((stream) => {
return new Promise((resolve) => { return new Promise((resolve, reject) => {
streamRef = stream; streamRef = stream;
video.setAttribute("autoplay", true); video.setAttribute("autoplay", true);
video.setAttribute('muted', true); video.setAttribute('muted', true);
video.setAttribute('playsinline', true); video.setAttribute('playsinline', true);
video.srcObject = stream; video.srcObject = stream;
video.addEventListener('loadedmetadata', () => { video.addEventListener('loadedmetadata', () => {
video.play(); video.play().then(resolve).catch(reject);
resolve();
}); });
}); });
}) })

Loading…
Cancel
Save