1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #14021 from dkurt:init_opencv_wasm

This commit is contained in:
Alexander Alekhin
2019-03-13 16:09:21 +00:00
2 changed files with 40 additions and 13 deletions
+13 -2
View File
@@ -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);