Webcam / Microphone Detection

I would like to create a page that determines if the user's camera / microphone works: http://www.tokbox.com/user-diagnostic/

I just need to be guided where to start.

Thanks!

+6
source share
4 answers

This jQuery plugin can provide you with a list of available webcams that the user has:

http://www.xarg.org/project/jquery-webcam-plugin/

If webcam.getCameraList().length == 0 , then you will find out that they do not have a webcam.

+1
source

In flash u you can use

  var cam:Camera = Camera.getCamera(); if (cam == null) { trace("User has no cameras installed."); } else { trace("User has at least 1 camera installed."); } 
+1
source

Try this .. to access your webcam

 $(function(){ //initialize camera in browser $("#camera").webcam({ width: 320, height: 240, mode: "callback", swffile: "jscam_canvas_only.swf", onTick: function() {}, onSave: function() {}, onCapture: function() {}, debug: function() {}, onLoad: function() {} }); }); var test; test = function(){ var tester = false; //try catch block for tight binding try{ //condition if length is 0 or undefined if(webcam.getCameraList().length == 0){ alert('You dont have a camera'); return; }else{ alert("cam detected"); return; } tester = true; }catch(e){ tester = false; setTimeout(test,1000); } } setTimeout(test,1000); </script> <div id="camera" style="opacity:0"></div> 
+1
source

Source: https://habr.com/ru/post/927692/


All Articles