移除多余逻辑
parent
aa7ab86b62
commit
af3b30096d
|
@ -240,7 +240,7 @@ const handlePlay = () => {
|
||||||
export const playList = (listId: string, index: number) => {
|
export const playList = (listId: string, index: number) => {
|
||||||
const prevListId = playInfo.playerListId
|
const prevListId = playInfo.playerListId
|
||||||
setPlayListId(listId)
|
setPlayListId(listId)
|
||||||
pause()
|
// pause()
|
||||||
setPlayMusicInfo(listId, getList(listId)[index])
|
setPlayMusicInfo(listId, getList(listId)[index])
|
||||||
if (appSetting['player.isAutoCleanPlayedList'] || prevListId != listId) clearPlayedList()
|
if (appSetting['player.isAutoCleanPlayedList'] || prevListId != listId) clearPlayedList()
|
||||||
clearTempPlayeList()
|
clearTempPlayeList()
|
||||||
|
@ -256,12 +256,12 @@ const handleToggleStop = () => {
|
||||||
|
|
||||||
const randomNextMusicInfo = {
|
const randomNextMusicInfo = {
|
||||||
info: null as LX.Player.PlayMusicInfo | null,
|
info: null as LX.Player.PlayMusicInfo | null,
|
||||||
index: -1,
|
// index: -1,
|
||||||
}
|
}
|
||||||
export const resetRandomNextMusicInfo = () => {
|
export const resetRandomNextMusicInfo = () => {
|
||||||
if (randomNextMusicInfo.info) {
|
if (randomNextMusicInfo.info) {
|
||||||
randomNextMusicInfo.info = null
|
randomNextMusicInfo.info = null
|
||||||
randomNextMusicInfo.index = -1
|
// randomNextMusicInfo.index = -1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -342,13 +342,13 @@ export const getNextPlayMusicInfo = async(): Promise<LX.Player.PlayMusicInfo | n
|
||||||
|
|
||||||
if (togglePlayMethod == 'random') {
|
if (togglePlayMethod == 'random') {
|
||||||
randomNextMusicInfo.info = nextPlayMusicInfo
|
randomNextMusicInfo.info = nextPlayMusicInfo
|
||||||
randomNextMusicInfo.index = nextIndex
|
// randomNextMusicInfo.index = nextIndex
|
||||||
}
|
}
|
||||||
return nextPlayMusicInfo
|
return nextPlayMusicInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePlayNext = (playMusicInfo: LX.Player.PlayMusicInfo) => {
|
const handlePlayNext = (playMusicInfo: LX.Player.PlayMusicInfo) => {
|
||||||
pause()
|
// pause()
|
||||||
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
|
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
|
||||||
handlePlay()
|
handlePlay()
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ const initAudio = () => {
|
||||||
audio.pause()
|
audio.pause()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const checkMusicUrl = async(url: string) => {
|
const checkMusicUrl = async(url: string): Promise<boolean> => {
|
||||||
initAudio()
|
initAudio()
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const clear = () => {
|
const clear = () => {
|
||||||
|
|
Loading…
Reference in New Issue