Fix worker coreURL for ESM (#657)

This commit is contained in:
Derek Christensen 2024-03-06 08:12:11 -07:00 committed by GitHub
parent 2c2e2e2ad9
commit f3a4ab9128
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,7 @@ const load = async ({
// when web worker type is `classic`.
importScripts(_coreURL);
} catch {
if (!_coreURL) _coreURL = CORE_URL.replace('/umd/', '/esm/');
if (!_coreURL || _coreURL === CORE_URL) _coreURL = CORE_URL.replace('/umd/', '/esm/');
// when web worker type is `module`.
(self as WorkerGlobalScope).createFFmpegCore = (
(await import(