Skip to content

Actions

You can interact with the component using the following methods

const idliveFaceCapture = document.querySelector('idlive-face-capture');

idliveFaceCapture.openCamera();

openCamera

Call openCamera to open the camera and show video

If device_id attribute was not specified it will prioritize by default FullHD cameras when on desktop, and front facing FullHD cameras when on mobile phones.

takePhoto

Once the camera is opened, you can call takePhoto to capture a photo

closeCamera

You can call closeCamera to close the camera at any time

setEncryptionKey

You can set your public encryption key using setEncryptionKey method. It accepts a Blob file with a key as a first argument and an optional second argument with the key ID

idliveFaceCapture.addEventListener('initialize', () => {
    idliveFaceCapture.setEncryptionKey(file);
});

setExternalMeta

You can set an external metadata to be included in the payload using setExternalMeta method. It accepts a string

idliveFaceCapture.addEventListener('initialize', () => {
    idliveFaceCapture.setExternalMeta('External metadata');
});

setLicense

You can set your licenses using setLicense method. It accepts a string with a license as a first argument and a string with a license type as a second

Available license types:

  • faceDetector
idliveFaceCapture.addEventListener('initialize', () => {
    idliveFaceCapture.setLicense(detectorLicense, 'faceDetector');
});

getLicenseInfo

After setting up a license with setLicense action, you can request information about it using setLicense method. It accepts a string with a license as a first argument

Available license types:

  • faceDetector
idliveFaceCapture.getLicenseInfo('faceDetector');