Refactor to import createFFmpegCore using importScripts in worker context
This commit is contained in:
parent
6e99e5f96f
commit
74ca423df2
@ -39,10 +39,10 @@ if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScop
|
|||||||
);
|
);
|
||||||
if (typeof createFFmpegCore === 'undefined') {
|
if (typeof createFFmpegCore === 'undefined') {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
globalThis.importScripts(corePath);
|
||||||
if (typeof createFFmpegCore === 'undefined') {
|
if (typeof createFFmpegCore === 'undefined') {
|
||||||
throw Error(CREATE_FFMPEG_CORE_IS_NOT_DEFINED(coreRemotePath));
|
throw Error(CREATE_FFMPEG_CORE_IS_NOT_DEFINED(coreRemotePath));
|
||||||
}
|
}
|
||||||
importScripts(corePath);
|
|
||||||
log('info', 'ffmpeg-core.js script loaded');
|
log('info', 'ffmpeg-core.js script loaded');
|
||||||
resolve({
|
resolve({
|
||||||
createFFmpegCore,
|
createFFmpegCore,
|
||||||
|
Loading…
Reference in New Issue
Block a user