Closed ggarro-ptech closed 1 year ago
Thanks for reporting this.
It seems emscripten changed the loader code for the WASM file.
< var _scriptDir =
< typeof document !== 'undefined' && document.currentScript
< ? document.currentScript.src
< : undefined
< if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename
---
> var _scriptDir =
> typeof document === 'undefined' && typeof location === 'undefined'
> ? new (require('u' + 'rl').URL)('file:' + __filename).href
> : typeof document === 'undefined'
> ? location.href
> : (document.currentScript && document.currentScript.src) ||
> new URL('mediainfo.js', document.baseURI).href
It now prefers location.href
over document.currentScript.src
.
We can easily override this using Emscripten Module locateFile
.
I updated the CodePen and the documentation to reflect this change.
Issue Summary
After updating to version 0.1.9 from CDN the library stopped working.
Steps to Reproduce
Additional info: It works fine if you use version 0.1.8 with this link https://unpkg.com/mediainfo.js@0.1.8/dist/mediainfo.min.js