0

Why do some Android devices expose all physical cameras in navigator.mediaDevices.enumerateDevices(), while other expose just one? The devices where I tested run on Android 10 or 11.

According to this documentation, devices running on Android 9 or higher will support exposing all cameras.

I also tried using the Camera 2 API, but without any luck. All I get is two cameras, one front and one back. But my device has 3 back cameras.

Do you know why I cannot access all cameras with Android 11? Or how to enable exposing all of them?

Thanks, Alin

Alin
  • 347
  • 2
  • 9
  • 2
    A vendor is not forced to expose all their camera hardware via the public apis : "With the inclusion of multi-camera support in the framework, Android best practices strongly recommend that phone manufacturers expose a logical camera for all physical cameras facing the same direction" - Android 9+ simply states "private apis", i.e apis that don't exist in the normal public sdk. Yet vendors can easily get around this with their own sdk-addons to create api's (this is the correct way vendors can add their own apis to a build that they can access in apps via a stubbed sdk-addon jar). – Mark Aug 18 '21 at 16:27
  • Thanks for your answer, @MarkKeen. What's the preferred solution to access those cameras from Android? Ultimately I want to get the image in some javascript code. – Alin Aug 18 '21 at 17:05

0 Answers0