File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,6 @@ module.exports = (_options = {}) => {
95
95
}
96
96
} ;
97
97
98
-
99
98
/*
100
99
* Determine whether the Core is loaded.
101
100
*/
@@ -171,6 +170,21 @@ module.exports = (_options = {}) => {
171
170
}
172
171
} ;
173
172
173
+ /**
174
+ * forcibly terminate the ffmpeg program.
175
+ */
176
+ const exit = ( ) => {
177
+ if ( Core === null ) {
178
+ throw NO_LOAD ;
179
+ } else {
180
+ running = false ;
181
+ Core . exit ( 1 ) ;
182
+ Core = null ;
183
+ ffmpeg = null ;
184
+ runResolve = null ;
185
+ }
186
+ } ;
187
+
174
188
const setProgress = ( _progress ) => {
175
189
progress = _progress ;
176
190
} ;
@@ -191,6 +205,7 @@ module.exports = (_options = {}) => {
191
205
load,
192
206
isLoaded,
193
207
run,
208
+ exit,
194
209
FS ,
195
210
} ;
196
211
} ;
Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ export interface FFmpeg {
77
77
setProgress ( progress : ProgressCallback ) : void ;
78
78
setLogger ( log : LogCallback ) : void ;
79
79
setLogging ( logging : boolean ) : void ;
80
+ exit ( ) : void ;
80
81
}
81
82
82
83
/*
You can’t perform that action at this time.
0 commit comments