From d870f420d732aebaab0a7074a353487eb2efcfde Mon Sep 17 00:00:00 2001 From: Nathan Johnson Date: Mon, 4 Apr 2022 23:18:07 -0500 Subject: [PATCH] Removed window type guard in createFFmpeg.js --- src/createFFmpeg.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/createFFmpeg.js b/src/createFFmpeg.js index c5425ce..61753ff 100644 --- a/src/createFFmpeg.js +++ b/src/createFFmpeg.js @@ -75,17 +75,14 @@ module.exports = (_options = {}) => { * as we are using blob URL instead of original URL to avoid cross origin issues. */ locateFile: (path, prefix) => { - if (typeof window !== 'undefined') { - 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 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']);