While the video streaming on Android and Safari in iOS is functioning perfectly, issues arise when attempting to use Chrome on iOS or an In-app Browser. The implementation involves Vue as a Single File Component.
The HTML code utilized is as shown below:
<video
height="400px"
width="300px"
autoplay
playsinline
/>
The Vue JS code used is outlined here:
data: () => ({
video: null,
}),
mounted() {
navigator.mediaDevices.getUserMedia({
audio: false,
// Prioritize Rear Camera
video: {facingMode: 'environment'},
})
.then((stream) => {
this.video = document.querySelector('video');
this.video.srcObject = stream;
this.video.tracks = stream.getTracks();
});
}
Any assistance or alternative approaches to resolve this issue would be highly appreciated. Our aim is to initiate a camera stream on the webpage and capture a photo upon clicking.