Fires when an error occurs.
An error message describing the error that occurred.
Fires when the user's camera goes live (i.e. showing a live preview). This will only happen after the user allows access to their camera.
Fires when the library finishes loading.
Fires once when the upload completes.
Status code as received from the server.
The raw response content as received from the server.
Fires repeatedly while an upload is in progress.
If you want to track progress while your image is uploading, you can register an event listener for the
uploadProgress
event. This event is called very frequently while an upload is in progress, and passes
the function a floating point number between 0.0 and 1.0 representing the upload progress:
Webcam.snap(data_uri => {
Webcam.on("uploadProgress", progress => {
// Upload in progress
// "progress" will be between 0.0 and 1.0
});
Webcam.on("uploadComplete", (code, text) => {
// Upload complete!
// "code" will be the HTTP response code from the server, e.g., 200
// "text" will be the raw response content
});
Webcam.upload(data_uri, "myScript.php");
});
A number between 0
and 1
, indicating the current progress. 0
means that the upload
just started, 1
means that the upload has finished.
Generated using TypeDoc
Mapping between the event names supported by photo cam and the callback function type for the event.