OkayLive Web Camera

  1. To use the front camera, always set the facingmode in constraint to “user” and set it to “environment” when rear camera is in need.

  2. But this is not the case when using certain Android phone with multiple rear camera like Huawei which split their camera into normal len and telephoto len when using rear camera.

  3. Detect the environment of the internet browser (Google chrome/Firefox) and phone's operating system

  4. Loop through all the videoinput (camera) device id of the phone and get the last device id, which normally indicate the normal len in Android phone.

  5. Set the device id into constraint and get the permission from user to use the camera in browser.

  6. Once the permission is granted, camera will be launched.

Last updated