Uploading and Analyzing Media

Server-Based Analyzes

Data to be uploaded and analyzed is stored in object sdkMediaResult, obtained after capturing and recording video. Upload it to the server and initiate required analyses via Oz API.

A simple scenario of interaction with Oz API can be implemented with theuploadMediaAndAnalyze method as described below.

val statusListener = object: StatusListener<List<OzAnalysisResult>> {
            override fun onStatusChanged(status: String?) { /*your code for showing status message*/ }
            override fun onSuccess(result:List <OzAnalysisResult>) { /*your code to handle analysis result*/ }
            override fun onError(error: OzException) { /*your code to handle analysis error*/ }
        }
        val analysisCancelable = OzLivenessSDK.uploadMediaAndAnalyze(
            mediaList,
            listOf(OzAnalysis.QUALITY, OzAnalysis.BIOMETRY),
            statusListener
        )

On-Device Analyzes

To run the on-device analyses instead of server-based, use the following methods:

OzLivenessSDK.runOnDeviceLivenessAnalysis(mediaList)
OzLivenessSDK.runOnDeviceBiometryAnalysis(mediaList)

Last updated