> 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/ios-sdk/modulos/video-grabacion.md).

# Video Recording

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

The *Component* handled in the current document is called ***VideoRecording Component***. It is responsible for capturing the device screen in the background. It is mainly intended for recording the Onboarding process.

## Dependencies

To avoid conflicts and compatibility issues, if you want to install the component in a project that contains an old version of the Facephi libraries (*Widgets*), these must be removed completely before installing the components of the ***SDKMobile***.

### CocoaPods

* Currently, FacePhi libraries are distributed remotely through different dependency managers, in this case CocoaPods. The dependencies **required** that must have been previously installed (by adding them to the project's Podfile file) are:

```swift
  pod 'FPHISDKMainComponent', '~> $VERSION'
```

* To install the Selphi component, the following entry must be included in the application's Podfile:

```swift
  pod 'FPHISDKVideoRecordingComponent', '~> $VERSION'
```

### SPM

* The mandatory dependencies that must have been installed previously are:

```sh
//HTTPS
https://github.com/facephi-clienters/SDK-SdkPackage-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-SdkPackage-SPM.git
```

* To install the SELPHI component, it must be included in the project's modules:

```swift
//HTTPS
https://github.com/facephi-clienters/SDK-VideoRecording-SPM.git
//SSH
git@github.com:facephi-clienters/SDK-VideoRecording-SPM.git
```

## Permissions

In the client application where the components will be integrated, it is necessary to include the following element in the file **Info.plist** when the recording is going to include audio:

```
It is necessary to allow microphone use (NSMicrophoneUsageDescription - Privacy - Microphone Usage Description)
```

{% hint style="info" %}
Microphone permission is only necessary if you activate **`enableAudio`** in **`VideoRecordingConfigurationData`**. By default **`enableAudio`** is **`false`** and the recording does not capture audio.
{% endhint %}

## Available controllers

| **Controller**            | **Description**                 |
| ------------------------- | ------------------------------- |
| FVideoRecordingController | Main Video Recording controller |

### Controller declaration

```swift
private var videoRecordingController: VideoRecordingController?
```

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

Errors will be returned as a 'VideoRecordingError' object.

Error list:

* VRC\_EMPTY\_LICENSE: The String of license is empty
* VRC\_INITIALIZATION\_ERROR: Initialization error
* VRC\_OPERATION\_NOT\_CREATED: There is no operation in progress
* VRC\_NETWORK\_CONNECTION: Internet connection error
* VRC\_MIC\_PERMISSION\_DENIED: The user has denied the permissions
* VRC\_WEB\_SOCKET\_REQUEST\_ERROR: Error in the connection to the services
* VRC\_UNKNOWN\_ERROR: Unknown error
* VRC\_JOIN\_CHANNEL\_ERROR: Error in the connection with the channel
* VRC\_VIDEO\_RECORDING\_ACTIVE: Cannot start because the Video Recording process is active
* VRC\_QUICKTIME\_RECORDING\_ACTIVE: Cannot start because the recording process is active: an external application is already recording the screen
* VRC\_WRONG\_CREDENTIALS\_ERROR: The credentials for connecting to the Video Recording service are not correct
