托盘菜单新增播放、切歌、收藏控制

This commit is contained in:
lyswhut
2024-03-29 15:59:00 +08:00
parent 9c0ae12959
commit 7a08cb5ddd
6 changed files with 125 additions and 25 deletions
+1
View File
@@ -143,6 +143,7 @@ const handleRestorePlay = async(restorePlayInfo: LX.Player.SavedPlayInfo) => {
setImmediate(() => {
if (musicInfo.id != playMusicInfo.musicInfo?.id) return
window.app_event.setProgress(appSetting['player.isSavePlayTime'] ? restorePlayInfo.time : 0, restorePlayInfo.maxTime)
window.app_event.pause()
})
@@ -59,6 +59,7 @@ export default () => {
const setProgress = (time: number, maxTime?: number) => {
if (!musicInfo.id) return
if (maxTime != null) setMaxplayTime(maxTime)
console.log('setProgress', time, maxTime)
if (time > 0) restorePlayTime = time
if (mediaBuffer.playTime) {
@@ -69,8 +70,6 @@ export default () => {
setNowPlayTime(time)
setCurrentTime(time)
if (maxTime != null) setMaxplayTime(maxTime)
// if (!isPlay) audio.play()
}