mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 20:01:47 +00:00
feat: add play and pause seperate song controller.
This commit is contained in:
@ -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();
|
||||
});
|
||||
};
|
||||
|
||||
@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user