-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
32 lines (32 loc) · 1.08 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/// <reference path="typings/tsd.d.ts" />
var plugins = {
path: require("path"),
ffmpeg: require("fluent-ffmpeg"),
Q: require("q")
};
var playcontrolConvert = {
from: function (pathArgFrom) {
var done = plugins.Q.defer();
pathArgFrom = plugins.path.resolve(pathArgFrom);
var inputFile;
var outputFile;
var result = {};
return {
to: function (pathArgTo, options) {
if (options === void 0) { options = "undefined"; }
pathArgTo = plugins.path.resolve(pathArgTo);
var convertCall = plugins.ffmpeg(pathArgFrom); //load file
convertCall.output(pathArgTo);
convertCall.on('progress', function (progress) {
console.log('Processing: ' + progress.percent + '% done');
});
convertCall.on('end', function () {
done.resolve();
});
convertCall.run();
return done.promise;
}
};
}
};
module.exports = playcontrolConvert;