# OkayID Web Camera

### Guidelines for Web Use Case

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.

{% file src="/files/-LxJsOlGDdq\_-OqqWg5Q" %}
OkayID\_Web\_Camera\_Demo\_App
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api-old.innov8tif.com/other/okayid-web-camera.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
