Implement SetRepeat to WSAPI
This commit is contained in:
parent
72ce1a6e15
commit
37e92a063b
1 changed files with 9 additions and 0 deletions
|
@ -163,6 +163,15 @@ export class wsapi {
|
||||||
case "repeat":
|
case "repeat":
|
||||||
this._win.webContents.executeJavaScript(`wsapi.toggleRepeat()`);
|
this._win.webContents.executeJavaScript(`wsapi.toggleRepeat()`);
|
||||||
break;
|
break;
|
||||||
|
case "set-repeat":
|
||||||
|
if (data.repeat === 0 || data.repeat === 1 || data.repeat === 2) {
|
||||||
|
this._win.webContents.executeJavaScript(`MusicKit.getInstance().repeatMode = ${data.repeat}`);
|
||||||
|
response.message = "Repeat " + data.repeat;
|
||||||
|
} else {
|
||||||
|
this._win.webContents.executeJavaScript(`wsapi.toggleRepeat()`);
|
||||||
|
response.message = "Invalid Repeat, toggling";
|
||||||
|
}
|
||||||
|
break;
|
||||||
case "seek":
|
case "seek":
|
||||||
this._win.webContents.executeJavaScript(`MusicKit.getInstance().seekToTime(${parseFloat(data.time)})`);
|
this._win.webContents.executeJavaScript(`MusicKit.getInstance().seekToTime(${parseFloat(data.time)})`);
|
||||||
response.message = "Seek";
|
response.message = "Seek";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue