-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
27 lines (25 loc) · 800 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
const electron = require('electron');
const ffmpeg = require('fluent-ffmpeg')
const { app, BrowserWindow, ipcMain } = electron;
let mainWindow;
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 800,
height: 600,
darkTheme: true,
webPreferences: { backgroundThrottling: false }
});
mainWindow.loadURL(`file://${__dirname}/src/index.html`);
});
ipcMain.on('videos:added', (event, videos) => {
// console.log(event);
// console.log(videos);
const promise = new Promise((resolve, reject) => {
ffmpeg.ffprobe(videos[0].path, (err, metadata) => {
// console.log(metadata);
// console.log(err);
resolve(metadata);
});
});
promise.then((metadata)=>{console.log(metadata)})
});