6

我想建立一个页面来检测用户的相机/麦克风是否与此类似:http ://www.tokbox.com/user-diagnostic/

我只需要指导从哪里开始。

谢谢!

4

4 回答 4

1

这个 jQuery 插件可以为您提供用户拥有的可用网络摄像头列表:

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

如果webcam.getCameraList().length == 0那样,您就会知道他们没有网络摄像头。

于 2012-10-14T20:24:20.153 回答
1

在闪存中你可以使用

 var cam:Camera = Camera.getCamera(); 
if (cam == null) 
{ 
    trace("User has no cameras installed."); 
} 
else 
{ 
    trace("User has at least 1 camera installed."); 
}
于 2012-10-15T13:34:50.860 回答
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>
于 2014-04-01T15:40:17.413 回答
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

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

I detected the camera number and the microphone number and pass it back to Javascript using ExternalInterface.

Works like a charm.

于 2014-04-01T21:02:26.820 回答