File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const toBlobURL = async (url, mimeType) => {
19
19
return blobURL ;
20
20
} ;
21
21
22
- module . exports = async ( { corePath : _corePath } ) => {
22
+ module . exports = async ( { corePath : _corePath , workerPath : _workerPath , wasmPath : _wasmPath } ) => {
23
23
if ( typeof _corePath !== 'string' ) {
24
24
throw Error ( 'corePath should be a string!' ) ;
25
25
}
@@ -29,11 +29,11 @@ module.exports = async ({ corePath: _corePath }) => {
29
29
'application/javascript' ,
30
30
) ;
31
31
const wasmPath = await toBlobURL (
32
- coreRemotePath . replace ( 'ffmpeg-core.js' , 'ffmpeg-core.wasm' ) ,
32
+ _wasmPath !== undefined ? _wasmPath : coreRemotePath . replace ( 'ffmpeg-core.js' , 'ffmpeg-core.wasm' ) ,
33
33
'application/wasm' ,
34
34
) ;
35
35
const workerPath = await toBlobURL (
36
- coreRemotePath . replace ( 'ffmpeg-core.js' , 'ffmpeg-core.worker.js' ) ,
36
+ _workerPath !== undefined ? _workerPath : coreRemotePath . replace ( 'ffmpeg-core.js' , 'ffmpeg-core.worker.js' ) ,
37
37
'application/javascript' ,
38
38
) ;
39
39
if ( typeof createFFmpegCore === 'undefined' ) {
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ type ProgressCallback = (progressParams: { ratio: number }) => any;
17
17
export interface CreateFFmpegOptions {
18
18
/** path for ffmpeg-core.js script */
19
19
corePath ?: string ;
20
+ /** path for ffmpeg-worker.js script */
21
+ workerPath ?: string ;
22
+ /** path for ffmpeg-core.wasm script */
23
+ wasmPath ?: string ;
20
24
/** a boolean to turn on all logs, default is false */
21
25
log ?: boolean ;
22
26
/** a function to get log messages, a quick example is ({ message }) => console.log(message) */
You can’t perform that action at this time.
0 commit comments