Update templates/index.html
Browse files- templates/index.html +12 -9
templates/index.html
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
-
<!-- devlim -->
|
| 2 |
<!DOCTYPE html>
|
| 3 |
<html lang="en">
|
| 4 |
<head>
|
|
@@ -83,13 +82,18 @@
|
|
| 83 |
const snap = document.getElementById('snap');
|
| 84 |
const context = canvas.getContext('2d');
|
| 85 |
const analysisResult = document.getElementById('analysisResult');
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
function processAnalysisResult(result) {
|
| 95 |
const match = result.match(/\d+/);
|
|
@@ -138,4 +142,3 @@
|
|
| 138 |
</script>
|
| 139 |
</body>
|
| 140 |
</html>
|
| 141 |
-
<!-- devlim -->
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
|
|
|
| 82 |
const snap = document.getElementById('snap');
|
| 83 |
const context = canvas.getContext('2d');
|
| 84 |
const analysisResult = document.getElementById('analysisResult');
|
| 85 |
+
|
| 86 |
+
navigator.mediaDevices.getUserMedia({
|
| 87 |
+
video: {
|
| 88 |
+
facingMode: { exact: "environment" }
|
| 89 |
+
}
|
| 90 |
+
})
|
| 91 |
+
.then(stream => {
|
| 92 |
+
video.srcObject = stream;
|
| 93 |
+
})
|
| 94 |
+
.catch(err => {
|
| 95 |
+
console.error("Error accessing webcam: " + err);
|
| 96 |
+
});
|
| 97 |
|
| 98 |
function processAnalysisResult(result) {
|
| 99 |
const match = result.match(/\d+/);
|
|
|
|
| 142 |
</script>
|
| 143 |
</body>
|
| 144 |
</html>
|
|
|