The Vidus SDK comes with a set of screens and configurations to record live video of customers. Each of the recording options in the SDK are called nodes which can be configured by developers.Vidus is supporting English and Hindi languages.
You can find the release history at Changelog
‼ ATTENTION ‼ → BREAKING CHANGE introduced at VIDUS SDK v2.3.4
. We have introduced a new license format. If you are using versions prior to v2.3.4
and intend to update to v2.3.4
or above please contact support@frslabs.com
for an updated license.
You will need a valid license and Netrc credentials to use the Vidus SDK, which can be obtained by contacting support@frslabs.com.
Depending on the license - offline or online - you have opted for, the ping functionality to billing servers will be disabled or enabled. For instance, if you have opted for the offline SDK model, then there will be no server ping needed to our billing server to bill you. However, if you have chosen a transaction based pricing, then after each transaction, a ping request will be made to our billing server. This cannot be overrided by the App. A point to note is that if the ping transaction fails for any reason, the whole transaction will be void without any results from the SDK.
Once you have the license , follow the below instructions for a successful integration of Vidus SDK onto your iOS Application.
- xcode 13
- iOS 13.0+
- Swift 5.0
In Info.plist file add following code to allow your application to access iPhone's camera and microphone:
<key>NSCameraUsageDescription</key> <string>Allow access to camera</string>
<key>NSMicrophoneUsageDescription</key> <string>Allow access to microphone</string>
To integrate Vidus into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://gitlab.com/frslabs-public/ios/vidus.git'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '13.0'
target '<Your Target Name>' do
use_frameworks!
pod 'VIDUS', '2.4.3'
pod 'Alamofire', '~> 4.9.1'
end
You will need a valid netrc credentials to install vidus from maven, which can be obtained by contacting support@frslabs.com
.
- Create or edit .netrc file under current user's home directory.
- Write the below lines into that file, replace <YOUR_USERNAME> and <YOUR_PASSWORD> with your credentials which is shared through email and save the file.
machine www.repo2.frslabs.space
login <YOUR_USERNAME>
password <YOUR_PASSOWRD>
- In terminal enter below command to install the pod
"pod install" or "pod update" or "pod install --repo-update".
- Connect with physical device to build and run Forus, It will not build/run in simulator due to camera dependency.
- Initialize the input parameters including the
nodes
to be invoked and import delegate RecordingDelegate
class YourViewController: UIViewController,RecordingDelegate {
func screenRecording(recording: ScreenNavigationViewController, didFinishRecordingWithResult results: VidusResults) {
// Success Response
let videoUrl = results.vidusVideoUrl
let secretNumberValidationResponse = results.SecretNumberVerificationStatus
let nodeReferenceData = results.nodeReferenceData
let imageReferenceId = results.imageReferenceId
}
func screenRecording(recording: ScreenNavigationViewController, didFailWithError error: String) {
// Get Error
let errorCode = error
}
var inputParam = [[String : String]]()
var inputParameters = [String : String]()
var nodeNameArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
// MARK: For Simple Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.simpleRecorderNode.rawValue, timeDuration: "10", baseUrl: nil, keyId: nil, keySecret: nil, messageText: nil, voiceType: nil, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For Challenge Code Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.challengeCodeNode.rawValue, timeDuration: nil, baseUrl: "Base_URL", keyId: "KEY_ID", keySecret: "KEY_SECRET", messageText: "Sample_Text", voiceType: nil, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For Challenge Text Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.challengeTextNode.rawValue, timeDuration: "10", baseUrl: nil, keyId: nil, keySecret: nil, messageText: "Sample Text", voiceType: nil, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For Declaration Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.declarationNode.rawValue, timeDuration: nil, baseUrl: nil, keyId: nil, keySecret: nil, messageText: "Sample Text", voiceType: VidusInput.VoiceType.byMacine.rawValue, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For OSV Recorder Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.oSVRecorderNode.rawValue, timeDuration: "10", baseUrl: nil, keyId: nil, keySecret: nil, messageText: nil, voiceType: nil, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For OSV Challenge Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.oSVChallengeTextNode.rawValue, timeDuration: "10", baseUrl: nil, keyId: nil, keySecret: nil, messageText: "sample text", voiceType: nil, questionID: nil,questionJsonString: "", questionTemplateString: "")
// MARK: For PIV Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.PIVNode.rawValue, timeDuration: nil, baseUrl: nil, keyId: "Enter Key ID", keySecret: "Enter Key Secret", messageText: "Enter Text", voiceType: nil, questionID: "Enter Question ID",questionJsonString: "", questionTemplateString: "")
// MARK: For PIVC Node
addNodeWithParam(nodeName: VidusInput.VidusInputNode.PIVCNode.rawValue, timeDuration: nil, baseUrl: nil, keyId: nil, keySecret: nil, messageText: nil, voiceType: nil, questionID: nil, questionJsonString: "ENTER QUESTION STRING", questionTemplateString: "ENTER TEMPLATE JSON STRING")
}
// ...
}
- Invoke Vidus SDK
// ...
override func viewDidAppear(_ animated: Bool) {
if inputParam.count > 0{
let recorder = ScreenNavigationViewController(delegate: self)
recorder.modalPresentationStyle = .fullScreen
recorder.recordingNodeName = nodeNameArray
recorder.nodeData = inputParam
recorder.recordingType = VidusInput.RecordingType.screen.rawValue
recorder.licenceKey = "ENTER LICENCE KEY"
recorder.serverHeader = "ENTER SERVER_HEADER"
recorder.referenceID = "ENTER_SERVER_REFERENCE_ID"
recorder.isEnableInstructionScreen = false/true
recorder.isEnablePreviewScreen = false/true
present(recorder, animated: true)
inputParam.removeAll()
}
}
// ...
- Call following fuction on viewDidLoad for provide input to vidus framework
// ...
func addNodeWithParam(nodeName:String,timeDuration:String?,baseUrl:String?,keyId:String?,keySecret:String?,messageText:String?,voiceType:String?,questionID:String?,questionJsonString:String?,questionTemplateString:String?) {
switch nodeName {
case VidusInput.VidusInputNode.simpleRecorderNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = timeDuration
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.challengeCodeNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = messageText
inputParameters[VidusInput.SDKInputParameter.baseUrl.rawValue] = baseUrl
inputParameters[VidusInput.SDKInputParameter.keyId.rawValue] = keyId
inputParameters[VidusInput.SDKInputParameter.keySecret.rawValue] = keySecret
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.challengeTextNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = messageText
inputParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = timeDuration
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.declarationNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.voiceType.rawValue] = voiceType
inputParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = messageText
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.oSVRecorderNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = timeDuration
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.oSVChallengeTextNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = messageText
inputParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = timeDuration
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.PIVNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = messageText
inputParameters[VidusInput.SDKInputParameter.baseUrl.rawValue] = baseUrl
inputParameters[VidusInput.SDKInputParameter.keyId.rawValue] = keyId
inputParameters[VidusInput.SDKInputParameter.keySecret.rawValue] = keySecret
inputParameters[VidusInput.SDKInputParameter.questionID.rawValue] = questionID
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
break
case VidusInput.VidusInputNode.PIVCNode.rawValue:
inputParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = nodeName
inputParameters[VidusInput.SDKInputParameter.fileTemplate.rawValue] = questionJsonString
inputParameters[VidusInput.SDKInputParameter.titleTemplate.rawValue] = questionTemplateString
nodeNameArray.append(nodeName)
inputParam.append(inputParameters)
default:
print("Error: Node is empty")
}
}
// ...
Vidus SDK has APIs to capture interactive realtime selfie video with customizable actions. Each functionality is separated into unique nodes
. The APIs are contained in the following input nodes.
-
PIV Node (Pre-Issuance Verification Node)
The Input Nodes are explained below,
Captures a video recording with a user defined time.
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = videoRecordTime | Sets the time(String) taken for the recording of the node.
Values should be between 10 and 100 |
Captures a video recording which will include a user-read 4 digit code prompted by a customizable machine-read question.
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = videoChallengeCodeText | Sets the text that will be spoken prior to displaying the code. |
nodeParameters[VidusInput.SDKInputParameter.baseUrl.rawValue] = videoApiBaseUrl | Vidus API Base URL. |
nodeParameters[VidusInput.SDKInputParameter.keyId.rawValue] = Key iD | Sets the key id. |
nodeParameters[VidusInput.SDKInputParameter.keySecret.rawValue] = Key SECRET | Sets the Key Secret id. |
Captures a video recording which will include a user-prompted answer with a customizable machine-read question.
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = videoChallengeText | Sets the text that will be spoken. |
nodeParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] videoChallengeTextTime | Sets the recording time() for the node after the text is spoken.
Values should be between 10 and 100 |
Captures a video recording which will include a user-read or machine-read text/declaration.
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = videoDeclarationText | Sets the text that will be displayed. |
nodeParameters[VidusInput.SDKInputParameter.voiceType.rawValue] = (int videoDeclarationSpokenMethod) | (OPTIONAL) Sets the way the text is to be spoken, Either by the user or by the machine. Values are VidusInput.VoiceType.byMacine.rawValue VidusInput.VoiceType.byUser.rawValue (Default Value) |
Captures a video recording with a user defined time.
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = videoRecordTime | Sets the time() taken for the recording of the node.
Values should be between 10 and 100 |
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = videoChallengeText | Sets the text that will be spoken. |
nodeParameters[VidusInput.SDKInputParameter.timeDuration.rawValue] = videoChallengeTextTime | Sets the recording time() for the node after the text is spoken.
Values should be between 10 and 100 |
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.challengeCodeText.rawValue] = videoChallengeCodeText | Sets the text that will be displayed. |
nodeParameters[VidusInput.SDKInputParameter.baseUrl.rawValue] = videoApiBaseUrl | Vidus API Base URL. |
nodeParameters[VidusInput.SDKInputParameter.keyId.rawValue] = Key iD | Sets the key id. |
nodeParameters[VidusInput.SDKInputParameter.keySecret.rawValue] = Key SECRET | Sets the Key Secret id. |
Public Methods | |
---|---|
nodeParameters[VidusInput.SDKInputParameter.nodeName.rawValue] = Nodename | Sets the Node name. |
nodeParameters[VidusInput.SDKInputParameter.fileTemplate.rawValue] = languageTemplatePath | sets the language template path". |
nodeParameters[VidusInput.SDKInputParameter.titleTemplate.rawValue] = questionTemplatePath | Sets the question data text. |
Following error codes will be returned on the onVidusFailure
method of the callback
CODE | DESCRIPTION |
---|---|
803 | Camera Permission deny |
804 | SDK is interrupted |
805 | Vidus SDK license expire |
806 | Vidus SDK license is invalid |
807 | Invalid Config |
808 | Transaction fail |
809 | Internet is not available |
810 | Timeout |
811 | Screen recording permision deny |
812 | Upload audio to server fail |
813 | Microphone permission deny |
814 | Upload screen images fail |
815 | Secret number verification fail |
818 | Upload screen recorded video fail |
819 | Timeout |
820 | Minimum time duration for recording is not set |
821 | Recording Video is Failed |
For any queries/feedback , contact us at support@frslabs.com