File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -163,9 +163,15 @@ export class FFmpeg {
163
163
*/
164
164
public load = ( config : FFMessageLoadConfig = { } ) : Promise < IsFirst > => {
165
165
if ( ! this . #worker) {
166
- this . #worker = new Worker ( new URL ( "./worker.js" , import . meta. url ) , {
167
- type : "module" ,
168
- } ) ;
166
+ if ( ! config . workerLoadURL ) {
167
+ this . #worker = new Worker ( new URL ( "./worker.js" , import . meta. url ) , {
168
+ type : "module" ,
169
+ } ) ;
170
+ } else {
171
+ this . #worker = new Worker ( config . workerLoadURL , {
172
+ type : "module" ,
173
+ } ) ;
174
+ }
169
175
this . #registerHandlers( ) ;
170
176
}
171
177
return this . #send( {
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ export interface FFMessageLoadConfig {
22
22
* @defaultValue `https://unpkg.com/@ffmpeg/core-mt@${CORE_VERSION}/dist/umd/ffmpeg-core.worker.js`;
23
23
*/
24
24
workerURL ?: string ;
25
+ /**
26
+ * `worker.js` URL.
27
+ *
28
+ * @defaultValue `new URL('./worker.js')`;
29
+ */
30
+ workerLoadURL ?: string ;
25
31
}
26
32
27
33
export interface FFMessageExecData {
You can’t perform that action at this time.
0 commit comments