blinkcard / blinkcard-in-browser

21 stars 11 forks source link

Readme examples are not up to date #25

Open joelhoelting opened 8 months ago

joelhoelting commented 8 months ago

After updating to version 2.7.0 and using the example code:

try
{
    const videoRecognizer = await BlinkCardSDK.VideoRecognizer.createVideoRecognizerFromCameraStream(
        cameraFeed,
        recognizerRunner
    );

    // There is more than one way to handle recognition

    // Using the recognize() method will provide you with the default behavior,
    // such as built-in error handling, timeout and video feed pausing.
    const processResult = await videoRecognizer.recognize();

    // Using the startRecognition() method allows you to pass your own onScanningDone callback, 
    // giving you the option to create custom behavior.
    const processResult = await videoRecognizer.startRecognition(
        async ( recognitionState ) => 
        {
            videoRecognizer.pauseRecognition();
            return recognitionState;
        }
    );

    // To obtain recognition results see next step
}
catch ( error )
{
    if ( error.name === "VideoRecognizerError" )
    {
        // Reason is of type BlinkCardSDK.NotSupportedReason and contains information why video
        // recognizer could not be used. Usually this happens when user didn't grant access to a
        // camera or when a hardware or OS error occurs.
        const reason = ( error as BlinkCardSDK.VideoRecognizerError ).reason;
    }
}

It appears that the VideoRecognizerError no longer exists on the BlinkCardSDK object:BlinkCardSDK.VideoRecognizerError. It appears that the example used in the readme and the example folder needs to get updated.

AngTim commented 8 months ago

Hello Joel,

Thank you for noticing the difference in the documentation and the repository examples. We are working on a new release of the BlinkCard SDK and will review the repository and the guidelines to update them accordingly.

The release should be out at the beginning of February, including additional features and accuracy fixes. Our developer will also ensure the documentation follows the current SDK changes.

Kind regards, Angelo Web Support Specialist Microblink LTD