mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-05 15:48:55 +08:00
修复潜在播放问题
This commit is contained in:
parent
ba25477d5b
commit
ca9003f076
@ -4,7 +4,7 @@ import { onDesktopLyricPositionChange, showDesktopLyric } from '@/core/desktopLy
|
||||
|
||||
export default async(setting: LX.AppSetting) => {
|
||||
await initLyricPlayer()
|
||||
setPlaybackRate(setting['player.playbackRate'])
|
||||
void setPlaybackRate(setting['player.playbackRate'])
|
||||
toggleTranslation(setting['player.isShowLyricTranslation'])
|
||||
toggleRoma(setting['player.isShowLyricRoma'])
|
||||
|
||||
|
@ -214,6 +214,7 @@ const handlePlay = async() => {
|
||||
* @param index 播放的歌曲位置
|
||||
*/
|
||||
export const playList = async(listId: string, index: number) => {
|
||||
await pause()
|
||||
setPlayListId(listId)
|
||||
setPlayMusicInfo(listId, getList(listId)[index])
|
||||
clearPlayedList()
|
||||
@ -237,6 +238,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
|
||||
if (playerState.tempPlayList.length) { // 如果稍后播放列表存在歌曲则直接播放改列表的歌曲
|
||||
const playMusicInfo = playerState.tempPlayList[0]
|
||||
removeTempPlayList(0)
|
||||
await pause()
|
||||
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
|
||||
await handlePlay()
|
||||
return
|
||||
@ -275,6 +277,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
|
||||
|
||||
if (index < playedList.length) {
|
||||
const playMusicInfo = playedList[index]
|
||||
await pause()
|
||||
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
|
||||
await handlePlay()
|
||||
return
|
||||
@ -326,6 +329,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
|
||||
isTempPlay: false,
|
||||
}
|
||||
|
||||
await pause()
|
||||
setPlayMusicInfo(nextPlayMusicInfo.listId, nextPlayMusicInfo.musicInfo)
|
||||
await handlePlay()
|
||||
}
|
||||
@ -365,6 +369,7 @@ export const playPrev = async(isAutoToggle = false): Promise<void> => {
|
||||
|
||||
if (index > -1) {
|
||||
const playMusicInfo = playedList[index]
|
||||
await pause()
|
||||
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
|
||||
await handlePlay()
|
||||
return
|
||||
@ -416,6 +421,7 @@ export const playPrev = async(isAutoToggle = false): Promise<void> => {
|
||||
isTempPlay: false,
|
||||
}
|
||||
|
||||
await pause()
|
||||
setPlayMusicInfo(nextPlayMusicInfo.listId, nextPlayMusicInfo.musicInfo)
|
||||
await handlePlay()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user