How to access mobile back camera

Hi I am working on to create custom AR experience on babylon without webxr, for that I need to access back camera of mobile but could not find any doc about it. Please help

This is more HTML5 question. Here is the very good article with example how to do it with the help of Javascript - How To Access Front and Rear Cameras with JavaScript's getUserMedia() | DigitalOcean

get usermedia i am able to do with it, but i want in babylon so i can use my custom AR features rendered .
Or if you could help me use the input from getusermedia converted to stream usable in babylon that will also be helpful

Here is one of the numerous examples - Babylon.js Playground, another -
Using the API method CreateFromWebCam - VideoTexture | Babylon.js Documentation - you can add in constraints for back mobile camera something like
{ audio: true, video: { facingMode: { exact: "environment" } } }
as described here - MediaDevices.getUserMedia() - Web APIs | MDN

1 Like