MobbScan Web: Migrations
2.5.* to 2.6.*
Public API
- The method
MobbScanAPI.setBaseUrlAgenthas been renamed toMobbScanAPI.setBaseURLAgent.
External libraries
The Mobbscan API has removed a lot of external libraries to reduce its weight and the load speed. The document detector has been separated from the face detector too. Now it only needs two external libraries that can be optionally included by the user. Those are jQuery 3.2.1 and xdomain-0.7.4 (only needed if you are going to use the method setBaseUrlWithCORS).
In order to use the face detector, you must include it as link on html like this:
<script type="text/javascript" src="../mobbscan-api/mobbscan-api-face-VERSION.min.js"></script>
CSS and component styles
The CSS files should now be manually included. This makes it possible to include MobbScan styles in your own stylesheets. If you want to use the MobbScan CSS file add the following in your HTML file:
<link type="text/css" rel="stylesheet" href="../mobbscan-api/css/mobbscan.css">
Enable mobile devices capture
To enable the detection using the native camera of a smartphone, but without opening the camera app, add the following:
MobbScanAPI.enableVideoMobileCapture();
Camera error management
To catch errors related with the camera acces, a new listener has been added:
MobbScanAPI.setErrorAccessingCamera(function (error, evidence) {
//Error management
});
This listener has two parameters, one called error of type Object with two attributes, error and code, and other parameter called evidence of type MobbScanEvidence.
Timeout management
To manage timeouts during the document detection, MobbScan provides two new methods which defines new listeners, the first one will be triggered when a document has not been detected during a period of time, and the second one is similar but only when this happens in a smartphone. Those methods are:
MobbScanAPI.setTimeOutListener(function (evidence) {
//Error management
});
MobbScanAPI.setTimeOutListenerVideoMobile(function (evidence) {
/Error management
});
