Help Needed: How to take and store photo using phone's camera on Axure?


#1

Hi everyone!

I’m an Axure newbie and I need some help. For the past week have been looking all over the forum and web for how I can: (1) take a photo using camera function on phone, and (2) store photo to specified location.

I managed to access camera using below, but I want to have another button where I am able to take photo, and store it somewhere. The latter is where I am not able to figure out.

Can someone please help?

javascript:navigator.mediaDevices.getUserMedia ({
audio: false,
video: true
}).then(function(stream) {
var video = document.querySelector(‘video’);
if (“srcObject” in video) {
video.srcObject = stream;
video.style.cssText = “-moz-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1);
transform: scale(-1, 1); filter: FlipH;”;
} else {
video.src = window.URL.createObjectURL(stream);}
video.onloadedmetadata = function() {
video.play(); };
}).catch(function(err) {
console.log(err.name + ": " + err.message);
});


#2

What do you mean “store photo to a specified location”? Save it as a file? Show it on the page?

This is really more of a JavaScript question, not an Axure question, so the answer depends on your specific requirements.