mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 10:23:33 +00:00
Force quit mpv on app close (#4)
This commit is contained in:
parent
b6fd3a4f66
commit
4614358163
4 changed files with 34 additions and 6 deletions
|
|
@ -44,7 +44,7 @@ const mpv = new MpvAPI(
|
|||
);
|
||||
|
||||
mpv.start().catch((error) => {
|
||||
console.log('error', error);
|
||||
console.log('error starting mpv', error);
|
||||
});
|
||||
|
||||
mpv.on('status', (status) => {
|
||||
|
|
@ -152,10 +152,14 @@ ipcMain.on('player-auto-next', async (_event, data: PlayerData) => {
|
|||
|
||||
// Sets the volume to the given value (0-100)
|
||||
ipcMain.on('player-volume', async (_event, value: number) => {
|
||||
mpv.volume(value);
|
||||
await mpv.volume(value);
|
||||
});
|
||||
|
||||
// Toggles the mute status
|
||||
ipcMain.on('player-mute', async () => {
|
||||
mpv.mute();
|
||||
await mpv.mute();
|
||||
});
|
||||
|
||||
ipcMain.on('player-quit', async () => {
|
||||
await mpv.quit();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue