added /api/playback/playpause

This commit is contained in:
booploops 2022-02-03 19:36:29 -08:00
parent eb505291f9
commit f9a2954e51
2 changed files with 7 additions and 0 deletions

View file

@ -153,6 +153,10 @@ export class BrowserWindow {
app.get("/api/playback/:action", (req, res)=>{
const action = req.params.action;
switch(action) {
case "playpause":
BrowserWindow.win.webContents.executeJavaScript("wsapi.togglePlayPause()")
res.send("Play/Pause toggle")
break;
case "play":
BrowserWindow.win.webContents.executeJavaScript("MusicKit.getInstance().play()")
res.send("Playing")