I am pretty new to javascript, and I want to make use of getUserMedia()
. When I go on this page everything works fine for me, chrome is asking me to allow access to my camera. But when I download source code of their site from their github and try to run that code locally, it doesn't work. Do I need anything additional to make it work? How can I debug that?
Asked
Active
Viewed 400 times
0

net.uk.sweet
- 12,444
- 2
- 24
- 42

ojek
- 9,680
- 21
- 71
- 110
2 Answers
1
You need to run the files from a webserver and not the local file-system, otherwise you'll get an error like this:
navigator.getUserMedia error: NavigatorUserMediaError {code: 1, PERMISSION_DENIED: 1}
Chrome comes with an excellent set of tools for debugging. The first thing you should do is hit F12 to launch them (assuming you're on Windows) and check the console for any errors. Then take the time to play around and familiarise yourself with the tools; they will be very useful to you ;).

net.uk.sweet
- 12,444
- 2
- 24
- 42
-
Oh well, you are right, from the server it works. I wonder why... Anyways, thanks. :) – ojek Mar 22 '13 at 13:55
-
Not sure to be honest. Maybe to do with security. – net.uk.sweet Mar 22 '13 at 14:08
0
You can use from local file also,but thing is you need a local webserver in you system like wamp.and place your file inside www folder.

Nisham Mahsin
- 1,399
- 5
- 19
- 43