mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Add onRuntimeInitialized for opencv.js
This commit is contained in:
parent
11dbd86aa3
commit
110e80f0ee
@ -8,8 +8,19 @@ function Utils(errorOutputId) { // eslint-disable-line no-unused-vars
|
||||
script.setAttribute('async', '');
|
||||
script.setAttribute('type', 'text/javascript');
|
||||
script.addEventListener('load', () => {
|
||||
console.log(cv.getBuildInformation());
|
||||
onloadCallback();
|
||||
if (cv.getBuildInformation)
|
||||
{
|
||||
console.log(cv.getBuildInformation());
|
||||
onloadCallback();
|
||||
}
|
||||
else
|
||||
{
|
||||
// WASM
|
||||
cv['onRuntimeInitialized']=()=>{
|
||||
console.log(cv.getBuildInformation());
|
||||
onloadCallback();
|
||||
}
|
||||
}
|
||||
});
|
||||
script.addEventListener('error', () => {
|
||||
self.printError('Failed to load ' + OPENCV_URL);
|
||||
|
Loading…
Reference in New Issue
Block a user