Closed Samiddha99 closed 1 year ago
It does not work on all models of mobile ?
Please provide the mobile model in details !
And try the following code at the mobile to check whether the front and rear camera is fine!
const stream1 = await navigator.mediaDevices.getUserMedia({video: {facingMode: "environment"}});
const video1 = document.createElement('video');
const stream2 = await navigator.mediaDevices.getUserMedia({video: {facingMode: "user"}});
const video2 = document.createElement('video');
document.body.appendChild(video1);
document.body.appendChild(video2);
video1.srcObject = stream1;
video2.srcObject = stream2;
video1.play();
video2.play();
the issue will be closed due to no further reply.
Setting
facingMode
toenvironment
increateMicrophoneAndCameraTracks()
forCameraVideoTrackInitConfig
, not switching the camera to back camera in mobile, it still using front camera.I have added the below configuration in my code: