i used below code to access webcam to capture image, but some time some reason webcam take some time to load. so at this time if use press capture button so alert message should be display like "Please let the webcam load"
<script type="text/javascript">
$(function () {
Webcam.set({
width: 320,
height: 240,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach('#webcam');
$("#btnCapture").click(function () {
Webcam.snap(function (data_uri) {
$("#imgCapture")[0].src = data_uri;
});
});
$("#btnCapture").click(function () {
$.ajax({
type: "POST",
url: "CaptureImage.aspx/saveimage",
data: "{data: '" + $("#imgCapture")[0].src + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json"
});
});
});
</script>