[英]Asp.net Jquery Webcam
我有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");
}
});
程序不會因為該錯誤事件而進入此cameraEnabled。 有幫助嗎?
問題解決了。 我完全從此網站http://sshilko.com/examples/jQuery-AS3-Webcam/example.html進行了跟蹤
錯誤是我沒有使用與網站相同的javascript文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.