mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-03 14:20:50 +08:00
🐞 fix(Play): 修复播放监听和vip歌曲解析问题
This commit is contained in:
@@ -196,6 +196,13 @@ const onAudio = () => {
|
||||
audio.value.removeEventListener('ended', handleEnded)
|
||||
audio.value.addEventListener('timeupdate', handleGetAudioTime)
|
||||
audio.value.addEventListener('ended', handleEnded)
|
||||
// 监听音乐播放暂停
|
||||
audio.value.addEventListener('pause', () => {
|
||||
store.commit('setPlayMusic', false)
|
||||
})
|
||||
audio.value.addEventListener('play', () => {
|
||||
store.commit('setPlayMusic', true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +266,7 @@ const setMusicFull = () => {
|
||||
background-color: rgba(0, 0, 0, 0.747);
|
||||
|
||||
.music-content {
|
||||
width: 200px;
|
||||
width: 140px;
|
||||
@apply ml-4;
|
||||
|
||||
&-title {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createStore } from "vuex";
|
||||
import { SongResult } from "@/type/music";
|
||||
import { createStore } from 'vuex'
|
||||
import { SongResult } from '@/type/music'
|
||||
import { getMusicUrl, getParsingMusicUrl } from '@/api/music'
|
||||
import homeRouter from '@/router/home'
|
||||
import { getMusicProxyUrl } from '@/utils'
|
||||
@@ -67,7 +67,7 @@ const getSongUrl = async (id: number) => {
|
||||
} catch (error) {
|
||||
console.error('error', error)
|
||||
}
|
||||
url = data.data[0].url
|
||||
url = url ? url : data.data[0].url
|
||||
return getMusicProxyUrl(url)
|
||||
}
|
||||
|
||||
@@ -77,10 +77,9 @@ const updatePlayMusic = async (state: State) => {
|
||||
state.play = true
|
||||
}
|
||||
|
||||
|
||||
const store = createStore({
|
||||
state: state,
|
||||
mutations: mutations,
|
||||
});
|
||||
})
|
||||
|
||||
export default store;
|
||||
export default store
|
||||
|
||||
Reference in New Issue
Block a user