Browse Source

ajout instascan

Daniel Le Berre 5 years ago
parent
commit
75bf739a9a
3 changed files with 27 additions and 1 deletions
  1. 2 1
      WebContent/index.html
  2. 25 0
      WebContent/instaScan.html
  3. 0 0
      WebContent/js/instascan.min.js

+ 2 - 1
WebContent/index.html

@@ -11,7 +11,8 @@
    </head>
 
    <body>
-
+	  <h1>Scanner</h1>
+	  <a href="instaScan.html">scanner</a>
       <header>
 
          <h1>Fréquentation des éspaces de microfolies</h1>

+ 25 - 0
WebContent/instaScan.html

@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Instascan</title>
+    <script type="text/javascript" src="https://rawgit.com/schmich/instascan-builds/master/instascan.min.js"></script>
+  </head>
+  <body>
+    <video id="preview"></video>
+    <script type="text/javascript">
+      let scanner = new Instascan.Scanner({ video: document.getElementById('preview') });
+      scanner.addListener('scan', function (content) {
+        console.log(content);
+      });
+      Instascan.Camera.getCameras().then(function (cameras) {
+        if (cameras.length > 0) {
+          scanner.start(cameras[0]);
+        } else {
+          console.error('No cameras found.');
+        }
+      }).catch(function (e) {
+        console.error(e);
+      });
+    </script>
+  </body>
+</html>

File diff suppressed because it is too large
+ 0 - 0
WebContent/js/instascan.min.js


Some files were not shown because too many files changed in this diff