答案 0 :(得分:1)
此jQuery插件可以为您提供用户拥有的可用网络摄像头列表:
http://www.xarg.org/project/jquery-webcam-plugin/
如果webcam.getCameraList().length == 0
,那么您就会知道他们没有网络摄像头。
答案 1 :(得分:1)
在flash中你可以使用
var cam:Camera = Camera.getCamera();
if (cam == null)
{
trace("User has no cameras installed.");
}
else
{
trace("User has at least 1 camera installed.");
}
答案 2 :(得分:1)
尝试此..以访问网络摄像头
$(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>
答案 3 :(得分:1)
我最终建立了自己的东西。
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Camera.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Microphone.html
我检测到了摄像机编号和麦克风编号,并使用ExternalInterface将其传回Javascript。
像魅力一样工作。