Having trouble figuring out why this works perfectly in Safari iOS and not Android Chrome throwing the exception NotReadableError: Could not start video source.
I am closing previous track with this.videoProducer.track.stop().
var constraints = {
audio: false,
video: {
"width": {
"ideal": 1280
},
"height": {
"ideal": 720
},
"facingMode": {
"exact": "environment"
},
},
}
const userMedia = await navigator.mediaDevices.getUserMedia(constraints) // Will throw - NotReadableError: Could not start video source
I also tried the constraints without width and height.
Have you tried to enumerate video devices and just pick another one by device ID?
I can be up to phone vendor to mark video input devices as front/back or maybe Chrome just doesn’t support that in the first place, no idea.
I did actually and will try it again but the interesting part in the Android device I test is that there are 3 devices returned where 2 are back camera!
Yes, that is what I meant, it probably doesn’t know if those are facing front or back. But maybe it also depends on the specific phone model, I can imagine Google to put something for this to work properly on Pixel devices.
I agree and this must be a phone device combination to Google Chrome issue since same phone device testing with Firefox browser actually works which is so interesting.
Out of curiosity, tried you code (just enveloped it in a minimal html page with video element), and it worked without a scratch both in Chrome and Firefox for Android. Android 7.1.2, Chrome 87.0.4280.101, Firefox 84.1.1
By the way, I have an old HP notebook with Windows 8.1 and some obscure problem with a built-in microphone, and sometimes Chrome issues very similar error, only for the audio device (‘Could not start audio source’). In Firefox it is either working at the same time or not - it depends. The error is cured only by the computer restart. So you problem can very easily be hardware.
I have a Galaxy A20s Android 10 with Chrome 87.0.4280.101 and Firefox 84.1.2.
I assume you comparing the audio issue and your machine hardware issue with my phone hardware which yes could be a phone issue, I will need to test it with another device.