I have a webpage and show the camera stream to a user so that the user can take a snapshot later. I am using navigator.mediaDevices.getUserMedia:
<video autoplay id="mycamtestvideo"></video>
<script>
navigator.mediaDevices.getUserMedia({video: true})
.then(function(stream){
video.src = window.URL.createObjectURL(stream);
localMediaStream = stream;
})
.catch(function(err){
console.log("error: "+err);
});
</script>
I can open the webpage in a browser on my PC and my android phone and see the camera stream just fine. However, when I create an android app from my webpage using gonative.io, the video is not rendered but just a gray box with a circle and a play button in it are shown at the location of the video. How should I access the camera in a converted gonative.io app?
Thanks.