添加debug日志

pull/2078/head^2
lyswhut 2024-10-25 19:56:59 +08:00
parent 7ac638c52c
commit b436497555
2 changed files with 12 additions and 1 deletions

View File

@ -259,17 +259,20 @@ const handleToggleStop = () => {
* @returns
*/
export const playNext = async(isAutoToggle = false): Promise<void> => {
console.log('skip next', isAutoToggle)
if (tempPlayList.length) { // 如果稍后播放列表存在歌曲则直接播放改列表的歌曲
const playMusicInfo = tempPlayList[0]
removeTempPlayList(0)
pause()
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
handlePlay()
console.log('play temp list')
return
}
if (playMusicInfo.musicInfo == null) {
handleToggleStop()
console.log('musicInfo empty')
return
}
@ -277,6 +280,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
const currentListId = playInfo.playerListId
if (!currentListId) {
handleToggleStop()
console.log('currentListId empty')
return
}
const currentList = getList(currentListId)
@ -306,6 +310,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
pause()
setPlayMusicInfo(playMusicInfo.listId, playMusicInfo.musicInfo, playMusicInfo.isTempPlay)
handlePlay()
console.log('play played list')
return
}
}
@ -320,6 +325,7 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
if (!filteredList.length) {
handleToggleStop()
console.log('filtered list empty')
return
}
// let currentIndex: number = filteredList.indexOf(currentList[playInfo.playerPlayIndex])
@ -349,9 +355,13 @@ export const playNext = async(isAutoToggle = false): Promise<void> => {
break
default:
nextIndex = -1
console.log('stop toggle play', togglePlayMethod, isAutoToggle)
return
}
if (nextIndex < 0) {
console.log('next index empty')
return
}
if (nextIndex < 0) return
const nextPlayMusicInfo = {
musicInfo: filteredList[nextIndex],

View File

@ -85,6 +85,7 @@ export default () => {
// setTimeout(() => {
if (window.lx.isPlayedStop) {
setAllStatus(t('player__end'))
console.log('played stop')
return
}
// resetPlayerMusicInfo()