Fixed node environment regression. Fixed test script commands in package.json

This commit is contained in:
Nathan Johnson
2022-04-05 18:21:07 -05:00
parent d870f420d7
commit 052337aeaa
2 changed files with 11 additions and 8 deletions

View File

@@ -75,14 +75,17 @@ module.exports = (_options = {}) => {
* as we are using blob URL instead of original URL to avoid cross origin issues.
*/
locateFile: (path, prefix) => {
if (typeof wasmPath !== 'undefined'
&& path.endsWith('ffmpeg-core.wasm')) {
return wasmPath;
}
if (typeof workerPath !== 'undefined'
&& path.endsWith('ffmpeg-core.worker.js')) {
return workerPath;
if (typeof window !== 'undefined' || typeof WorkerGlobalScope !== 'undefined') {
if (typeof wasmPath !== 'undefined'
&& path.endsWith('ffmpeg-core.wasm')) {
return wasmPath;
}
if (typeof workerPath !== 'undefined'
&& path.endsWith('ffmpeg-core.worker.js')) {
return workerPath;
}
}
return prefix + path;
},
});
ffmpeg = Core.cwrap('proxy_main', 'number', ['number', 'number']);