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>
source share