For the complete documentation index, see llms.txt. This page is also available as Markdown.

Video Call - VideoCall

This component requires a minimum iOS13 version

Introduction

The Video Call is managed with the VideoCall Component.

This component is responsible for managing communication between a user and an agent (video assistance). Its main processes are:

  • Internal management of cameras, microphone, and permissions.

  • Connection with the services.

In the section of Simplified Launch the steps required for the SDK's basic integration are detailed. This section adds the information for launching this component.

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 completely removed before installing the components of the SDKMobile.

CocoaPods

  • The mandatory dependencies that must have been previously installed (by adding them to the project's Podfile file) are:

pod 'FPHISDKMainComponent', '~> $VERSION'
  • To install the Video Call component, the following entry must be included in the application's Podfile:

pod 'FPHISDKVideoCallComponent', '~> $VERSION'

SPM

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

  • To install the Video Call component, it must be included in the project's modules:

Available controllers

Controller

Description

VideoCallController

Main video call controller

Simplified Launch

Once the SDK has been started and a new operation has been created, the component can be launched. Any of its controllers can be used to execute its functionality.

Launch:

extensionIdentifier must match the Bundle Identifier of the Broadcast Upload Extension screen sharing extension that you add in your app (see Screen sharing extension).

Screen sharing extension

From version 2.8.1, the Broadcast Upload Extension to share screen during the video call is configured in the integrating app and is associated with the component Video Call through extensionIdentifier.

Steps in the integrating app

  1. In Xcode, add a target Broadcast Upload Extension to the app project (e.g. File → New → Target → Broadcast Upload Extension).

  2. Define a Bundle Identifier unique for the extension (e.g. com.organization.app.videocallExtension).

  3. Use that identifier as extensionIdentifier when creating VideoCallController (see the launch example above).

  4. In the target and the extension, an App Group capability must be added of type App Group. When doing so, the same name must be entered both in the target and in the extension.

  5. In the Info.plist of the extension, modify NSExtensionPrincipalClass so that its value is videocallComponent.VideoExtensionHandler.

  6. If installed via CocoaPods, the extension target must be added to the Podfile and its dependency with VideoCall. If installed with SPM, the VideoCall dependency must be added to the extension target.

  7. Enable activateScreenSharing in VideoCallConfigurationData when you want to offer screen sharing in the call.

There is a programming example with this functionality built in and configured.

In versions 2.8.0 and earlier, the broadcast extension could be associated with the flow of Video Recording. Starting from 2.8.1 that responsibility passes to Video Call.

Basic configuration

The basic configuration required will not need any parameter.

Receiving the result

The controllers will return the necessary information in SdkResult format.

Error handling

In the error section, we will have the common class ErrorType.

  • VCL_CANCEL_BY_USER: The user has canceled the process

  • VCL_CANCEL_LAUNCH: A general cancellation of the SDK has been made

  • VCL_COMPONENT_LICENSE_ERROR: The component license is not correct

  • VCL_EMPTY_LICENSE: The license String is empty

  • VCL_FACE_DETECTION_TIMEOUT: No face detected

  • VCL_INITIALIZATION_ERROR: Initialization error

  • VCL_MANAGER_NOT_INITIALIZED: The managers are null

  • VCL_NETWORK_CONNECTION: Error in the internet connection

  • VCL_NO_DATA_ERROR: The input data is null

  • VCL_OPERATION_NOT_CREATED: There is no operation in progress

  • VCL_PERMISSION_DENIED: The user has rejected the permissions

  • VCL_SOCKET_ERROR: Error in the services connection

  • VCL_TIMEOUT: Timeout in the process

  • VCL_VIDEO_ERROR: Error in video processing

  • VCL_UNKNOWN_ERROR: Unknown error

  • VCL_VIDEO_RECORDING_ACTIVE: It cannot be started because the video recording process is active

Successful execution reception - data

In successful execution, it simply reports that everything went well with SdkResult.Success.

When the result is Success and the flag sharingScreen is active, screen sharing can be enabled.

Advanced information

This section expands on the component information.

Advanced component configuration

The fields included in the configuration, normally do not need to be provided since they are completed internally through the license used.

activateScreenSharing

Enable the screen sharing option in the call.

url

Video socket path

apiKey

ApiKey required for connection with the video socket

tenantId

Tenant identifier referring to the current client, necessary for connection to the video service.

vibrationEnabled

If set to true, vibration is enabled on errors and if the widget response is OK

Component customization

Apart from the changes that can be made at the SDK level (which are explained in the document on SDK Customization), this specific component allows its interface to be modified.

Texts

The texts can be customized by overwriting the value of the following keys in a Localizable.strings. The keys containing the suffix _alt are the literals used in the accessibility labels needed for the functionality of voice over.

Name

Value

video_call_component_exit_alert_question

Are you sure you want to end the call?

video_call_component_exit_alert_finish

Finish

video_call_component_exit_alert_accept

Accept

video_call_component_exit_alert_cancel

Cancel

video_call_component_skip

SKIP

video_call_component_restart

RETRY

video_call_component_agent

Assistant

video_call_component_text_waiting_agent_title

Connecting with an assistant...

video_call_component_close_button_alt

Close

video_call_component_back_button_alt

Back

video_call_component_timeout_title

Time exceeded

video_call_component_timeout_desc

Could not connect with an agent.

This way, if you want to modify, for example, the text “Finish” of the key video_call_component_exit_alert_finish for the language is, you should go to the file Localizable.strings in the folder es.lproj if it exists (if not, it must be created), and there add:

"video_call_component_exit_alert_finish"="Finish";

If a message is not specified in the language file, it will be filled with the default message.

Colors

The colors are initialized similarly in the colors variable with a dictionary, having as value a UIColor you want.

Animations

The animations to use are initialized similarly in the animations variable with a dictionary, having as value a string with the name of the animation found in xcassets that you want to use.

Last updated