Jquery Webcam拍照问题
调用webcam的capture()函数,然后报TypeError: webcam.capture is not a function(…),完全不明白为啥,以下是代码(官方Demo,几乎没有修改),求大神指点!
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery-webcam-master</title>
<link href="cs.css" rel="stylesheet" type="text/css">
<script src="http://www.jq22.com/jquery/1.11.1/jquery.min.js"></script>
<script src="jquery.webcam.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
jQuery("#webcam").webcam({
width: 320,
height: 240,
mode: "callback",
swffile: "jscam_canvas_only.swf", // canvas only doesn't implement a jpeg encoder, so the file is much smaller
onTick: function(remain) {
if (0 == remain) {
jQuery("#status").text("Cheese!");
} else {
jQuery("#status").text(remain + " seconds remaining...");
}
},
onSave: function(data) {
var col = data.split(";");
},
onCapture: function () {
webcam.save();
},
debug: function (type, string) { },
onLoad: function () {
// Page load
var cams = webcam.getCameraList();
for(var i in cams) {
jQuery("#cams").append("<li>" + cams[i] + "</li>");
}
}
});
});
</script>
</head>
<body>
<div id="webcam"></div>
<input type="button" value="Capture" onclick="webcam.capture()" />
</body>
</html>