Hello, I'm trying to use the 'Camera.Reactive' library in my application. Everything works well, but when I try to change the camera (front to back), sometimes, it doesn't work.
I stop the current track, get the new mediaStream and start the new stream, nothing of this returns any error. But the screen does not show the image of the back camera.
Important points:
I tried playing all stream types: facingMode: "environment" facingMode : exact "environment" deviceId : "the id of back camera"
2 - the error only occurs with the back camera - on some devices (Android only)
3 - After a few tries the change works and it shows the image of the camera
4 - I minified all the JS code to try to isolate the error, but nothing works
5 - By inspecting the smartphone or tablet in google:\\inspect I can make it work, removing the class from the parent element of and setting a fixed width for it, but when I use JS code to automatically remove the class, it doesn't work . Also if I just remove the class and open the screen it doesn't work either
Notable observations:
Tried using facingMode: "environment", exact "environment", and deviceId—same issue.
Problem occurs only with the back camera and only on certain Android devices.
The stream seems to load eventually after a few attempts.
Inspecting via chrome://inspect and manually modifying the DOM (removing a class and applying fixed width) makes it work—but doing the same via JavaScript doesn’t help.
Is there a known compatibility quirk or rendering issue for Android back cameras, or any best practices to handle stream switching in this case?