MobbScan Cordova: Video Conference
Introduction
Some workflows need the intervention of a human to verify the identity of a user. MobbScan covers this with the Video Conference feature, which can open a video call between the user that is being identified and an agent.
The conference will be recorded in the Validation portal, even if the agent part is integrated in an external web. More specifically, it will record the audio and video of the client, and the audio of the agent. The recording will only start when an agent starts the conference.
To enable this feature, some extra steps are needed that will be described below.
Installation
In version v2.23.0 the video conference feature was extracted to an external cordova plugin. This means that, if you want to include this feature, you must install this plugin along with the main MobbScan plugin.
In order to do this, you must follow these steps:
Take a look to the main plugin requirements.
Add the following line to the project
config.xml
file, if you want to add the latest version of the plugin:
<plugin name="com.mobbeel.mobbscanvideo" spec="npm:@mobbeel/mobbscan-videoconference-cordova-plugin@^2.22.0" />
Or, if you are using Cordova >= 10 add the following line instead:
<plugin name="com.mobbeel.mobbscanvideo" spec="@mobbeel/mobbscan-videoconference-cordova-plugin@^2.22.0"/>
You can also install a specific version of the plugin:
<plugin name="com.mobbeel.mobbscanvideo" spec="npm:@mobbeel/mobbscan-videoconference-cordova-plugin@2.22.1"/>
Type the following in the root of your Cordova project:
WARNING: This step will take several minutes, because it downloads the Android and iOS SDKs.
$ npx cordova prepare
$ npx ionic cordova prepare
- To confirm your installation, type the following in your Cordova project:
$ npx cordova plugin list
$ npx ionic cordova plugin list
The MobbScan plugin should appear like this (version can vary):
com.mobbeel.mobbscanvideo 2.22.0 "MobbScanVideo"
Configure the Video Conference API
The agent URL should be set (notice that MobbScanApiVideo
is being used instead of MobbScanAPI
):
MobbScanVideoAPI.setBaseURL("https://yourvideoinstance.yourcompany.com", onSuccess, onFailure);
The first parameter should be a URL pointing to the video instance. Second argument onSuccess
accepts a function which will be called if everything goes OK. Third argument onFailure
accepts a function which will be called in case of error.
After that you can init the API:
MobbScanVideoAPI.init(onSuccess, onFailure);
How to use
After initializing MobbScanVideoAPI
, you can launch the Video Conference UI with the following method:
MobbScanVideoAPI.start(scanId, onVideoSuccess, onVideoFailure);
This method takes three arguments:
scanID
: Identifier of the current scan process.onVideoSuccess
: Function that will be called when the video conference ends correctly. It will receive one boolean argument that will betrue
if the user is the one who ended the call.onVideoFailure
: Function that will be called if something fails.
Check verification status
Once the video conference is finished, the status of the verification depends on the agent. You can check the current status with the following method:
MobbScanVideoAPI.checkVerificationProcessResult(scanID, status => console.log(status), console.error);
Check network quality
The quality of the call can be checked with the following method, it will return to the callback passed as first parameter a quality score from 1 to 5:
MobbScanVideoAPI.setNetworkQualityCallback(onQualityCallback);