> 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

This component requires iOS 13 or later.

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

The *component* discussed in this document is called ***VideoRecording Component***. It captures the device screen in the background. It is primarily 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 Facephi libraries (*Widgets*), they must be completely removed before installing the ***SDKMobile***.

### CocoaPods

* FacePhi libraries are currently distributed remotely through different dependency managers, in this case CocoaPods. The **required** dependencies must be installed beforehand (by adding them to the project's Podfile):

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

* To install the Selphi component, add the following entry to the application's Podfile:

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

### SPM

* The required dependencies that must be installed beforehand 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, add it to 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, add the following entry to the **Info.plist** file when the recording is to include audio:

```
Microphone access must be permitted (NSMicrophoneUsageDescription - Privacy - Microphone Usage Description)
```

{% hint style="info" %}
Microphone permission is only required if you enable **`enableAudio`** in **`VideoRecordingConfigurationData`**. By default, **`enableAudio`** it **`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?
```

### Receiving errors <a href="#id-61-recepcion-de-errores" id="id-61-recepcion-de-errores"></a>

Errors are returned as a 'VideoRecordingError' object.

List of errors:

* 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\_MIC\_PERMISSION\_DENIED: The user denied permission
* VRC\_WEB\_SOCKET\_REQUEST\_ERROR: Error connecting to the services
* VRC\_UNKNOWN\_ERROR: Unknown error
* VRC\_JOIN\_CHANNEL\_ERROR: Error connecting to the channel
* VRC\_VIDEO\_RECORDING\_ACTIVE: Cannot start because video recording is already in progress
* VRC\_QUICKTIME\_RECORDING\_ACTIVE: Cannot start because an external application is already recording the screen
* VRC\_WRONG\_CREDENTIALS\_ERROR: The credentials for connecting to the video recording service are incorrect
