mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-13 20:00:05 +01:00
TakePhoto fixes (#641)
This commit is contained in:
20
dist/image-sequencer.js
vendored
20
dist/image-sequencer.js
vendored
@@ -67475,7 +67475,7 @@ module.exports={
|
||||
"desc": "RGBA values separated by a space",
|
||||
"default": "0 0 0 255"
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
},{}],208:[function(require,module,exports){
|
||||
@@ -69244,13 +69244,10 @@ function setInputStepInit() {
|
||||
context = canvas.getContext('2d'),
|
||||
vendorUrl = window.URL || window.webkitURL;
|
||||
|
||||
navigator.getMedia = navigator.getUserMedia || navigator.wekitGetUserMedia ||
|
||||
navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||
const constraints = { audio: false,video: true};
|
||||
|
||||
navigator.getMedia({
|
||||
video: true,
|
||||
audio: false
|
||||
}, function(stream){ // success callback
|
||||
function handleSuccess(stream) {
|
||||
window.stream = stream; // make stream available to browser console
|
||||
video.srcObject = stream;
|
||||
video.onloadedmetadata = function(e) {
|
||||
video.play();
|
||||
@@ -69258,9 +69255,12 @@ function setInputStepInit() {
|
||||
document.getElementById('close').addEventListener('click', function () {
|
||||
stopStream(stream);
|
||||
});
|
||||
}, function(error){ // error
|
||||
console.log("error");
|
||||
});
|
||||
}
|
||||
function handleError(error) {
|
||||
console.log('navigator.getUserMedia error: ', error);
|
||||
}
|
||||
navigator.mediaDevices.getUserMedia(constraints).then(handleSuccess).catch(handleError);
|
||||
|
||||
|
||||
document.getElementById('capture').addEventListener('click', function(stream){
|
||||
context.drawImage(video, 0, 0, 400, 300);
|
||||
|
||||
2
dist/image-sequencer.min.js
vendored
2
dist/image-sequencer.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -39,13 +39,10 @@ function setInputStepInit() {
|
||||
context = canvas.getContext('2d'),
|
||||
vendorUrl = window.URL || window.webkitURL;
|
||||
|
||||
navigator.getMedia = navigator.getUserMedia || navigator.wekitGetUserMedia ||
|
||||
navigator.mozGetUserMedia || navigator.msGetUserMedia;
|
||||
const constraints = { audio: false,video: true};
|
||||
|
||||
navigator.getMedia({
|
||||
video: true,
|
||||
audio: false
|
||||
}, function(stream){ // success callback
|
||||
function handleSuccess(stream) {
|
||||
window.stream = stream; // make stream available to browser console
|
||||
video.srcObject = stream;
|
||||
video.onloadedmetadata = function(e) {
|
||||
video.play();
|
||||
@@ -53,9 +50,12 @@ function setInputStepInit() {
|
||||
document.getElementById('close').addEventListener('click', function () {
|
||||
stopStream(stream);
|
||||
});
|
||||
}, function(error){ // error
|
||||
console.log("error");
|
||||
});
|
||||
}
|
||||
function handleError(error) {
|
||||
console.log('navigator.getUserMedia error: ', error);
|
||||
}
|
||||
navigator.mediaDevices.getUserMedia(constraints).then(handleSuccess).catch(handleError);
|
||||
|
||||
|
||||
document.getElementById('capture').addEventListener('click', function(stream){
|
||||
context.drawImage(video, 0, 0, 400, 300);
|
||||
|
||||
Reference in New Issue
Block a user