简体   繁体   中英

Asp.net Jquery Webcam

I have 2 webcam connected to my pc. I am using this library https://github.com/infusion/jQuery-webcam .

I am able to view the webcam no problem and I can also change to other camera by right clicking, and the Adobe Flash Player will popup where I can select other camera.

Following this website: http://sshilko.com/examples/jQuery-AS3-Webcam/example.html

The example shown in that website, it can change the camera by selecting from the dropdownlist.

But my code stucks at

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

Error says "No camera mode present, falling back...".

Below that code is another code

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");
                }
            });

The program wont event enter this cameraEnabled because of the error. Any helps?

Problem solved. I followed exactly from this website http://sshilko.com/examples/jQuery-AS3-Webcam/example.html

The error was i was not using the same javascript file as the website.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM