mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-13 11:50:02 +01:00
close webcam auto. after clicking picture (#1816)
Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
@@ -52,9 +52,10 @@ function setInputStepInit() {
|
||||
video.play();
|
||||
};
|
||||
|
||||
document.getElementById('capture').addEventListener('click', function(stream){
|
||||
document.getElementById('capture').addEventListener('click', function(){
|
||||
context.drawImage(video, 0, 0, 400, 300);
|
||||
options.onTakePhoto(canvas.toDataURL());
|
||||
setTimeout(stopStream(stream),1); // wait for 1 second before closing webcam so that image loads properly
|
||||
});
|
||||
|
||||
document.getElementById('close').addEventListener('click', function () {
|
||||
|
||||
Reference in New Issue
Block a user