Skip to content

Commit

Permalink
feat: add extension conf
Browse files Browse the repository at this point in the history
  • Loading branch information
drawcall committed Oct 11, 2021
1 parent da448a3 commit 9d04d28
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/conf/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Conf {
this.copyByDefaultVal(conf, 'antialias', false);
this.copyByDefaultVal(conf, 'audioLoop', true);
this.copyByDefaultVal(conf, 'ffmpeglog', false);
this.copyByDefaultVal(conf, 'ext', 'mp4');
this.copyByDefaultVal(conf, 'preset', 'medium');
this.copyByDefaultVal(conf, 'cacheFormat', 'raw');
this.copyByDefaultVal(conf, 'cacheQuality', 80);
Expand Down
5 changes: 3 additions & 2 deletions lib/creator.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ class FFCreator extends FFCon {
* @public
*/
generateOutput() {
let outputDir = this.getConf('outputDir');
const ext = this.getConf('ext');
const outputDir = this.getConf('outputDir');
if (this.inCenter && outputDir) {
this.setOutput(path.join(outputDir, `${Utils.genUuid()}.mp4`));
this.setOutput(path.join(outputDir, `${Utils.genUuid()}.${ext}`));
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ffcreator",
"version": "6.2.2",
"version": "6.2.3",
"description": "FFCreator is a lightweight and flexible short video production library",
"main": "lib/index.js",
"types": "types/index.d.ts",
Expand Down

0 comments on commit 9d04d28

Please sign in to comment.