feat: send current track to main process and provide an api

This commit is contained in:
qier222 2021-04-28 01:09:17 +08:00
parent c564d03c17
commit 07455c8ecd
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
3 changed files with 15 additions and 0 deletions

View file

@ -177,6 +177,14 @@ export default class {
setInterval(() => {
this._progress = this._howler === null ? 0 : this._howler.seek();
}, 1000);
// 发送正在播放的信息给主进程
setInterval(() => {
ipcRenderer.send('playerInfo', {
currentTrack: this.currentTrack,
progress: this._progress,
});
}, 1000);
}
_getNextTrack() {
if (this._playNextList.length > 0) {