feat: add play and pause seperate song controller.

This commit is contained in:
Manish
2021-10-13 12:27:13 +05:30
parent 88ee0fb989
commit a76f12c01c
3 changed files with 29 additions and 6 deletions

View File

@ -15,4 +15,22 @@ module.exports = () => {
videoStream.pause();
}
});
ipcRenderer.on("play", () => {
if (!videoStream) {
videoStream = document.querySelector(".video-stream");
}
if (videoStream.paused) videoStream.play();
});
ipcRenderer.on("pause", () => {
if (!videoStream) {
videoStream = document.querySelector(".video-stream");
}
videoStream.yns_pause ?
videoStream.yns_pause() :
videoStream.pause();
});
};

View File

@ -13,6 +13,8 @@ module.exports = (win) => {
previous: () => pressKey(win, "k"),
next: () => pressKey(win, "j"),
playPause: () => win.webContents.send("playPause"),
play: () => win.webContents.send("play"),
pause: () => win.webContents.send("pause"),
like: () => pressKey(win, "_"),
dislike: () => pressKey(win, "+"),
go10sBack: () => pressKey(win, "h"),