Open jamesbarrett95 opened 1 year ago
There is currently no way to see if a frame is still being processed, but it can be added in a future release.
This error triggers if the video is still playing, as it checks for its .paused
property, so that's one way you can check.
Another one is to wait for the VideoRecognizer.startRecognition()
to resolve as it uses processImage()
under the hood.
Thanks for the reply @ivancuric.
Another one is to wait for the
VideoRecognizer.startRecognition()
to resolve as it usesprocessImage()
under the hood.
Does it? Because once it's resolved, it seems as if there are still some background tasks executed by Blink ID, hence why the question was asked in the first place. See screenshot 1 which illustrates a browser log containing the output of BlinkIdCombinedRecognizer.getResult()
followed by some network calls, initiated by Blink ID. See screenshot 2, which illustrates the corresponding Blink ID network call, initiated by processImage
.
Screenshot 1:
Screenshot 2:
It should: https://github.com/BlinkID/blinkid-in-browser/blob/master/src/MicroblinkSDK/VideoRecognizer.ts#L712-L728.
Thanks for the feedback, I'll try to see what's going on.
Is there any chance you could provide a minimal reproduction sample on a repository?
Problem Statement:
After successfully capturing the the user's documents in our application, we dispose of all the video resources, destroy the component from the DOM, and redirect to a 'confirmation' screen which displays a preview of what Blink ID has captured. We display a retry button at the bottom of that confirmation screen which, once clicked, will navigate back and re-initialize the component which is responsible for creating a new
VideoRecognizer
.Our problem is that if the retry button is clicked whilst the
processImage()
background task is executing, then we receive an error when attempting to initialize a newVideoRecognizer
, which causes our application to break.Question / Feature Request
Is there a way to 'wait' until the async
processImage()
task has finished executing such that we can control when the user is allowed to hit retry?Additional Information
Version "@microblink/blinkid-in-browser-sdk": "^5.18.0"
Error when trying to recreate a new VideoRecognizer, immediately after capturing a document:![image](https://user-images.githubusercontent.com/15526293/223558859-4aa003ce-274d-4414-b38e-395f96d8a632.png)