Removed window type guard in createFFmpeg.js

This commit is contained in:
Nathan Johnson 2022-04-04 23:18:07 -05:00
parent 74ca423df2
commit d870f420d7

View File

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