Face-Detection-JavaScript icon indicating copy to clipboard operation
Face-Detection-JavaScript copied to clipboard

camera is not showing in browser

Open PratyushKes opened this issue 4 years ago • 12 comments

HI there, my chrome is unable to show the camera, i mean my camera is not opening on chrome.

PratyushKes avatar Sep 13 '20 19:09 PratyushKes

are you using "localhost" or "127.0.0.1" or "0.0.0.0"? try one of those. Also check https flag at "chrome://flags" and enable that to check if it works

vinamramunot-tech avatar Oct 08 '20 08:10 vinamramunot-tech

are you using "localhost" or "127.0.0.1" or "0.0.0.0"? try one of those. Also check https flag at "chrome://flags" and enable that to check if it works

what should i enable?

Ikigainuxxxx avatar Dec 13 '20 06:12 Ikigainuxxxx

@Ikigainuxxxx https://community.spiceworks.com/how_to/154601-chrome-allow-localhost-site-even-without-https-certificate

vinamramunot-tech avatar Dec 17 '20 07:12 vinamramunot-tech

This didn't work!

Dushyantsingh-ds avatar Dec 31 '20 00:12 Dushyantsingh-ds

@Dushyantsingh-ds can you share an image and the output of the server when you try to run it? I want to see the output on terminal or the console in dev tools.

vinamramunot-tech avatar Jan 12 '21 19:01 vinamramunot-tech

@WebDevSimplified you can close this issue

vinamramunot-tech avatar Jan 22 '21 02:01 vinamramunot-tech

@vinamramunot-tech I am having this issue as well and I have no errors whatsoever but the camera just wont show up

AlexDinger avatar Apr 03 '21 01:04 AlexDinger

@AlexDinger are you running this on http or https?

one alternative is to enable chrome flags:

  1. go to chrome and in the url bar type "chrome://flags"
  2. enable this flag Screen Shot 2021-04-03 at 11 35 30 PM
  3. run your website as "localhost:". you can have the port number as anything you want, an example is localhost:5050

vinamramunot-tech avatar Apr 04 '21 03:04 vinamramunot-tech

@AlexDinger Also check if any other application is using the camera. Are you running the code on mac/linux or windows?

vinamramunot-tech avatar Apr 04 '21 03:04 vinamramunot-tech

The actual green camera light goes on, but no image appears on the screen, just a white background. At this url: http://127.0.0.1:5500/face-detection/index.html And this warning in the console: Screen Shot 2021-04-26 at 8 07 49 AM

mister-bee avatar Apr 26 '21 15:04 mister-bee

@mister-bee try "http://localhost:5500/face-detection/index.html" and enable the flag I have talked about in the previous comment.

vinamramunot-tech avatar Apr 28 '21 20:04 vinamramunot-tech

function startVideo() { navigator.mediaDevices.getUserMedia({ video: {} }).then(stream => { const video = document.getElementById('video') video.srcObject = stream video.paly() }) .catch( err => { console.log('Failed to get local stream' ,err); }) }

use this startVideo function instead.

abdelmark avatar Mar 23 '22 15:03 abdelmark