> For the complete documentation index, see [llms.txt](https://api-old.innov8tif.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-old.innov8tif.com/other/okaylive-web-camera.md).

# 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.

{% file src="/files/-LxJvhDBIrv1duwFP0xD" %}
OkayLive\_Web\_Camera\_Demo\_App
{% endfile %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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/okaylive-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.
