Skip to content

Commit 9d04d28

Browse files
committed
feat: add extension conf
1 parent da448a3 commit 9d04d28

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/conf/conf.js

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class Conf {
2929
this.copyByDefaultVal(conf, 'antialias', false);
3030
this.copyByDefaultVal(conf, 'audioLoop', true);
3131
this.copyByDefaultVal(conf, 'ffmpeglog', false);
32+
this.copyByDefaultVal(conf, 'ext', 'mp4');
3233
this.copyByDefaultVal(conf, 'preset', 'medium');
3334
this.copyByDefaultVal(conf, 'cacheFormat', 'raw');
3435
this.copyByDefaultVal(conf, 'cacheQuality', 80);

lib/creator.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ class FFCreator extends FFCon {
8787
* @public
8888
*/
8989
generateOutput() {
90-
let outputDir = this.getConf('outputDir');
90+
const ext = this.getConf('ext');
91+
const outputDir = this.getConf('outputDir');
9192
if (this.inCenter && outputDir) {
92-
this.setOutput(path.join(outputDir, `${Utils.genUuid()}.mp4`));
93+
this.setOutput(path.join(outputDir, `${Utils.genUuid()}.${ext}`));
9394
}
9495
}
9596

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ffcreator",
3-
"version": "6.2.2",
3+
"version": "6.2.3",
44
"description": "FFCreator is a lightweight and flexible short video production library",
55
"main": "lib/index.js",
66
"types": "types/index.d.ts",

0 commit comments

Comments
 (0)