-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathindex.js
29 lines (25 loc) · 865 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
"use strict";
const path = require("path");
const {BrowserWindow, app} = require("electron");
const {getPluginEntry} = require("../index");
require("electron-debug")({showDevTools: false});
const pdir = path.join(__dirname, "..", "build", "Release");
if (process.platform !== "linux") {process.chdir(pdir);}
app.commandLine.appendSwitch("no-sandbox");
app.commandLine.appendSwitch("ignore-gpu-blacklist");
app.commandLine.appendSwitch("register-pepper-plugins", getPluginEntry(pdir));
app.on("ready", () => {
const win = new BrowserWindow({
width: 1280,
height: 574,
autoHideMenuBar: true,
useContentSize: process.platform !== "linux",
title: "mpv.js example player",
webPreferences: {plugins: true},
});
win.setMenu(null);
win.loadURL(`file://${__dirname}/index.html`);
});
app.on("window-all-closed", () => {
app.quit();
});