0

Consider this:

enter image description here

What I'm trying to do here is to get a MediaStream for environment facing camera (back) when another MediaStream for user facing camera (front) is active. This is happening on Android Chrome 94 and Android MS Edge 93, therefore I think it's probably a webview related issue, not sure. I tested this on an Xiaomi phone and on 2 different Samsung tablets.

If I stop the track from the front stream before creating the new stream, I don't have any issue at all.

It's really strange, because same piece of code works perfectly on PC (Windows) Chrome (not tried macOS or iOS at the moment).

Thing is that stopping the first track before creating the second stream will give the user a pretty bad experience (with blank screen for a while), which I'd like to avoid. Also there could be some use cases (e.g. PiP) in which using both cameras at once could be necessary... I can't see why this isn't/shouldn't be working.

Do you guys have any suggestion?

Thanks

Claudio Valerio
  • 2,302
  • 14
  • 24
  • This is very likely to be a device-hardware capability issue. Chromium definitely allows multiple MediaStreams if the device allows them. – O. Jones Nov 04 '21 at 11:37
  • It seems more an Android Webview issue. Literally any Android device where i tested this had the same behaviour, so far... – Claudio Valerio Nov 05 '21 at 16:37

0 Answers0