-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmpv.js
More file actions
30 lines (25 loc) · 811 Bytes
/
mpv.js
File metadata and controls
30 lines (25 loc) · 811 Bytes
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
const { BrowserWindow, app } = require('electron')
const path = require('path')
const pluginPath = path.join(__dirname, 'ppapi/build/Release', 'mpv-win32-x64-pepper_49.dll')
app.commandLine.appendSwitch('no-sandbox')
app.commandLine.appendSwitch("register-pepper-plugins", `${pluginPath};application/x-player`);
app.on("ready", () => {
const win = new BrowserWindow({
width: 1280,
height: 574,
autoHideMenuBar: true,
title: "mpv example player",
webPreferences: {
plugins: true,
nodeIntegration: false,
webSecurity: true,
javascript: true
},
});
win.setMenu(null);
win.loadURL(`file://${__dirname}/mpv.html`);
win.webContents.openDevTools({ mode: 'detach' });
})
app.on("window-all-closed", () => {
app.quit();
});