> For the complete documentation index, see [llms.txt](https://docs.facephi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.facephi.com/docs.facephi-en/products/idv-suite/flujos-and-integraciones/configuracion-tecnica-del-cliente/sdk-mobile/android-sdk/componentes-modulos/video-grabacion.md).

# Video Recording

## Introduction <a href="#id-1-introduccion" id="id-1-introduccion"></a>

Screen video recording is performed with the ***VideoRecording Component***.

This component is responsible for capturing the device screen in the background. It is mainly oriented toward recording the Onboarding process.

***

## Dependency <a href="#id-2-dependencia" id="id-2-dependencia"></a>

The specific component dependency is:

```
implementation "com.facephi.androidsdk:video_recording_component:$version"
```

***

## Available controllers <a href="#id-3-controladores-disponibles" id="id-3-controladores-disponibles"></a>

| **Controller**                | **Description**                     |
| ----------------------------- | ----------------------------------- |
| FVideoRecordingController     | Main video recording controller.    |
| FStopVideoRecordingController | Controller to stop video recording. |

### Error handling <a href="#id-61-recepcion-de-errores" id="id-61-recepcion-de-errores"></a>

Errors will be returned as a 'VideoRecordingError' object.

List of errors:

<details>

<summary>List of video recording errors:</summary>

* VRC\_CANCEL\_BY\_USER: The user has canceled the process
* VRC\_COMPONENT\_LICENSE\_ERROR: The component License is not valid
* VRC\_EMPTY\_LICENSE: The License string is empty
* VRC\_INITIALIZATION\_ERROR: Initialization error
* VRC\_OPERATION\_NOT\_CREATED: There is no operation in progress
* VRC\_NETWORK\_CONNECTION: Internet connection error
* VRC\_PERMISSION\_ERROR: The user has denied the necessary permissions. With `enableAudio=true` it also covers the denial or dismissal of microphone permission and the denial of the permission of `MediaProjection`.
* VRC\_SOCKET\_ERROR: Error in the services connection
* VRC\_UNKNOWN\_ERROR: Unknown error
* VRC\_VIDEO\_CALL\_ACTIVE: Cannot start because there is an active Video Call
* VRC\_VIDEO\_ERROR: Error in video processing
* VRC\_VIDEO\_RECORDING\_ACTIVE: Cannot start because the video recording process is active
* VRC\_FETCH\_DATA\_ERROR: Error in the result retrieval

</details>

## Advanced configuration <a href="#id-7-configuracion-avanzada" id="id-7-configuracion-avanzada"></a>

The controller uses `VideoRecordingConfigurationData` to configure the connection to the video service and the recording behavior:

* `url`: Path to the video socket. It is normally obtained from the License, except in On-Premise environments.
* `apiKey`: Key required for the connection to the video socket.
* `tenantId`: Identifier of the client tenant.
* `enableAudio`: Enables audio capture during screen recording. By default `false`. If provided as `true`, Android requests `RECORD_AUDIO` before the `MediaProjection`; if the user denies or dismisses the permission, the component returns `VRC_PERMISSION_ERROR`.

## Receiving the successful result - *data* <a href="#id-8-recepcion-del-resultado-correcto-data" id="id-8-recepcion-del-resultado-correcto-data"></a>

In case of success, `data` contains a `VideoRecordingResult`.

* `state`: Recording status. `SHARING` indicates that the recording has started and `FINISH` indicates that it has been stopped successfully.
