blinkcard / blinkcard-in-browser

21 stars 11 forks source link

getting promise pending for BlinkCardSDK.loadWasmModule(loadSettings) #24

Open yashikaraheja opened 1 year ago

yashikaraheja commented 1 year ago

JSON.stringify(loadSettings):

'{"allowHelloMessage":true,"engineLocation":"file:///D:/node/myproject/blinkcard-in-browser/resources","workerLocation":"http://192.168.1.9:3000/blinkcard-sdk.min.js","wasmType":null,"numberOfWorkers":null,"wasmModuleName":"BlinkCardWasmSDK","licenseKey":"sRwAAAYJbG9jYWxob3N0r/lOPmg/w35CpOHWLcIXyZqx58jBjDQEgc9g8PbxdaaDM+jedRKGXjqKQKz7ocX5/uQ6wvwfkHd4iovo1UDxWg4K+dstSEarVzTkBgKXX7iqpHoOjlU1pXPWbWBGasvjaoC2sKOnT7RozIdO8ljPeJVQO0owX3JzguXvoYK3p2ZtlcV/ndSC43hDJjKy4ACGg4Cul5jogfwPEdtJ7bk0XmtamIvtCVSnqQMfF1EwxCXOHw=="}'

AngTim commented 1 year ago

Hello Yashikaraheja,

Thank you for the inquiry. From the mentioned issue and the code snippet you have shared with us, it seems like you are not hosting the engine and worker location on the same path locally. Can you please check the following help article https://help.microblink.com/s/direct-article?Article=ka08W000000st37QAA and modify the path accordingly to have it match for engine location as it is for the worker location.

Test this approach and let me know if you have any additional questions or issues we can assist you with.

Kind regards, Angelo Web Support Specialist Microblink

yashikaraheja commented 1 year ago

app.js:185 Uncaught (in promise) SDKError {message: 'Media devices not supported by browser.', code: 'VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED', details: {…}} code : "VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED" details : {reason: 'MediaDevicesNotSupported'} message : "Media devices not supported by browser." [[Prototype]] : Object

Getting this error now I am using edge and chrome, its not working in any of them

AngTim commented 1 year ago

Hello Yashikaraheja,

One of the possible reasons for this error with 'MediaDevicesNotSupported', could be due to permissions policy, and it could be helpful to try and access the application with the HTTPS protocol, as media devices can be blocked due to insecure browser context: https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy

NotAllowedError DOMException Thrown if one or more of the requested source devices cannot be used at this time. This will happen if the browsing context is insecure (that is, the page was loaded using HTTP rather than HTTPS). It also happens if the user has specified that the current browsing instance is not permitted access to the device, the user has denied access for the current session, or the user has denied all access to user media devices globally. On browsers that support managing media permissions with Permissions Policy, this error is returned if Permissions Policy is not configured to allow access to the input source(s).

And you can also find more about the error from our documentation: https://github.com/blinkcard/blinkcard-in-browser/blob/5f2c6a486e3f0244c8cf6de0329fadd47ee2e4a1/src/MicroblinkSDK/VideoRecognizer.ts#L32C5-L32C29

Kind regards, Angelo

yashikaraheja commented 12 months ago

Thanks it resolved the issue in my local

yashikaraheja commented 12 months ago

Now i am facing another issue, i am trying to integrate in my company project which is backbone js based

i added a model class

define([], function () { 'use strict; const initialMessaget1 - document-getelementById("msg"); const progressEl - document.getelementById(load-progress"); // UI elements for scanning feedback const cameraFeed - document. getElementByld("camera-feed") 3 const cameraFeedback - document. getelementBy!Id("camera-feedback") : const drawcontext = cameraFeedback 8& cameraFeedback.getcontext("2d") ; const scanFeedback - document. getelementById("camera-guides*): return FIL.Core.Model.extend ({

returns; } // 1. It's possible to obtain a free trial license key on microblink.com let licensekey = *SRWAAAYVZmIkZwxpdHkuY2FyZC5zY2FubmVyVKMGr013POEGNfvyF5adUhJAt1SGnUsMmIUJO1KWNL.nqVPM8Y58SONZZktOcYT7Y8qR1c4H8mje7DN/StQcEbnwU3C4BaAU1PMEUQ0YC1Ba/NVZUeU73LyXMLZnI/kwNMjucr7hYux9yxdXT8: if (window. location. hostname==="blinkcard.github.io”) { licenseKey = "SRWAAAYTYmxpbmtjYX>kLmdpdGh1Yi5pby+N7zvPySD9Mbe+K362×H841POSUiZTDjd3UMrotMvNG40WJpwsc8vh+SYmFWkssv+Biodkzoa6iMHgneL.nPJx01p3rcRal8VRJUJ0098xSeGazX90jyjXMsDBoBm3tor+672Wr3f03Dg17u9; if (window. location. hostname === "localhost. fidelity.co.uk") { licensekey = "SRWAAAVYbG9 jYwxob3NOLmZpZGV/SaXR5LmNVLnVrIRJ j×9Ez+Mnwx5kozdG6DKP6reRszbMTfDND6p1H2rQ1AQ2a3jyACfVDNqvskbRK206n5pzN9igpdxeuuvDJsPhmQQDWhS7Av/up7AVL.11.JDz8y+8wtAQPN'mBgNJoumd+kg2GTU/OP”

Rest same code And in index.html I added script for cdn blinkcard

but now i am getting error that BlinkCardSDK not defined. This is for web