Add the debugfollowing function to the webcam function.
$("#camera").webcam({
width: 320,
debug: function(type, message) {
if (message === "Camera started") { window.webcam.started = true; }
}
});
We cannot verify that the inaction is true (i.e. muted === true), but now we can verify that or / webcam.startedis significant :trueundefinedfalse
function capture_image(){
if( !webcam.started ) { alert("hey, camera not started"); }
}
How to record an event
There is no event as such, except an event debug. You can do one ...
First do the following:
$("#camera").webcam({
width: 320,
debug: function(type, string) {
if (string === "Camera started") {
window.webcam.started = true;
if (window.webcam.onStarted) { window.webcam.onStarted(); }
}
}
});
Then add the function to our new event webcam.onStarted:
window.webcam.onStarted = function () {
alert("Whey, the webcam started");
};
source
share