-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
41 lines (35 loc) · 849 Bytes
/
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
33
34
35
36
37
38
39
40
41
var os = require("os");
var path = require("path");
var platform = os.platform();
//patch for compatibility with electron-builder, for smart built process.
if (platform == "darwin") {
platform = "mac";
} else if (platform == "win32") {
platform = "win";
}
//adding browser, for use case when module is bundled using browserify. and added to html using src.
if (
platform !== "linux" &&
platform !== "mac" &&
platform !== "win" &&
platform !== "browser"
) {
console.error("Unsupported platform.", platform);
process.exit(1);
}
var arch = os.arch();
if (arch === "ia32") {
console.error("Unsupported architecture.");
process.exit(1);
}
if (arch === "arm64") {
arch = "x64";
}
var ffmpegPath = path.join(
__dirname,
"bin",
platform,
arch,
platform === "win" ? "ffmpeg.exe" : "ffmpeg"
);
exports.path = ffmpegPath;