首页 文章

Asp.net Jquery网络摄像头

提问于
浏览
0

我有2个网络摄像头连接到我的电脑 . 我正在使用这个库https://github.com/infusion/jQuery-webcam .

我能够查看网络摄像头没问题,我也可以通过右键单击更改为其他相机,并且Adobe Flash Player将弹出,我可以选择其他相机 .

关注这个网站:http://sshilko.com/examples/jQuery-AS3-Webcam/example.html

该网站显示的示例,它可以通过从下拉列表中选择来更改相机 .

但我的代码仍然坚持

debug: function (type, string) {
            if (type == 'error') {
                $("#lblCameraList").html(string);
            } else {
                $("#lblCameraList").html('');
            }
        },

错误说“没有相机模式,后退......” .

下面的代码是另一个代码

cameraEnabled: function () {
            this.debug('notice', 'Camera enabled');
            var cameraApi = this;

            if (cameraApi.isCameraEnabled) {
                return;
            } else {
                cameraApi.isCameraEnabled = true;
            }

            var cams = cameraApi.getCameraList();

            for (var i in cams) {
                $("#cboCamera").append("<asp:ListItem Value='" + i + "'>" + cams[i] + "</asp:ListItem>");
            }

            $("#cboCamera").change(function () {
                var success = cameraApi.setCamera($(this).val());

                if (!success) {
                    //webcam.debug('error', 'Unable to select camera');
                    console.log("Failed to set camera");
                } else {
                    //webcam.debug('notice', 'Camera Changed');
                    console.log("Success set camera");
                }
            });

该程序不会因为错误而进入此摄像机 . 有帮助吗?

1 回答

相关问题