ilar06 commited on
Commit
e49e65b
1 Parent(s): df4252c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +11 -8
index.html CHANGED
@@ -40,14 +40,17 @@
40
  const output = document.getElementById('output');
41
  const captureButton = document.getElementById('capture');
42
 
43
- // Access the mobile camera
44
- navigator.mediaDevices.getUserMedia({ video: true })
45
- .then(stream => {
46
- video.srcObject = stream;
47
- })
48
- .catch(err => {
49
- console.error("Error accessing the camera: ", err);
50
- });
 
 
 
51
 
52
  captureButton.addEventListener('click', () => {
53
  // Draw the video frame to the canvas
 
40
  const output = document.getElementById('output');
41
  const captureButton = document.getElementById('capture');
42
 
43
+ navigator.mediaDevices.getUserMedia({
44
+ video: {
45
+ facingMode: { exact: "environment" }
46
+ }
47
+ })
48
+ .then(stream => {
49
+ video.srcObject = stream;
50
+ })
51
+ .catch(err => {
52
+ console.error("Error accessing the camera: ", err);
53
+ });
54
 
55
  captureButton.addEventListener('click', () => {
56
  // Draw the video frame to the canvas