修复播放器的停止逻辑问题

This commit is contained in:
lyswhut
2022-02-24 17:23:33 +08:00
parent 0f0be95c12
commit 6105a331aa
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -104,7 +104,7 @@ export const getPlayIndex = (listId, musicInfo, isTempPlay) => {
}
const list = getList(listId)
if (list?.length) {
if (list?.length && musicInfo) {
if (musicInfo.key) { // 已下载的歌曲
const currentKey = musicInfo.key
playIndex = list.findIndex(m => m.key == currentKey)
@@ -27,7 +27,6 @@ import {
setMusicInfo,
musicInfoItem,
playMusicInfo,
playInfo,
setPlayList,
setPlayMusicInfo,
playedList,
@@ -227,7 +226,7 @@ export default ({ setting }) => {
return
}
if (playInfo.musicInfo) {
if (playMusicInfo.musicInfo) {
setPlayerStop()
window.eventHub.emit(eventPlayerNames.pause)
setStopStatus()
@@ -285,6 +284,7 @@ export default ({ setting }) => {
const handelStop = () => {
setPlayerStop()
setPlayMusicInfo(playMusicInfo.listId, null)
window.eventHub.emit(eventPlayerNames.stop)
}