refactor(Player): 移除调试用的console.log语句
清理播放器组件中用于调试的console.log输出语句,保持代码整洁
This commit is contained in:
parent
1a700659ae
commit
5ded7f4f9d
|
@ -12,10 +12,7 @@ const playQueueStore = usePlayQueueStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const player = useTemplateRef('playerRef')
|
const player = useTemplateRef('playerRef')
|
||||||
|
|
||||||
console.log('[Player] 组件初始化')
|
|
||||||
|
|
||||||
watch(() => playQueueStore.isPlaying, (newValue) => {
|
watch(() => playQueueStore.isPlaying, (newValue) => {
|
||||||
console.log('[Player] 播放状态变化:', newValue)
|
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
player.value?.play()
|
player.value?.play()
|
||||||
setMetadata()
|
setMetadata()
|
||||||
|
@ -37,7 +34,6 @@ function artistsOrganize(list: string[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function setMetadata() {
|
function setMetadata() {
|
||||||
console.log('[Player] 设置元数据')
|
|
||||||
if ('mediaSession' in navigator) {
|
if ('mediaSession' in navigator) {
|
||||||
navigator.mediaSession.metadata = new MediaMetadata({
|
navigator.mediaSession.metadata = new MediaMetadata({
|
||||||
title: playQueueStore.list[playQueueStore.currentIndex].song.name,
|
title: playQueueStore.list[playQueueStore.currentIndex].song.name,
|
||||||
|
@ -128,16 +124,13 @@ watch(() => playQueueStore.list.length, async (newLength) => {
|
||||||
|
|
||||||
// 监听音频元素变化
|
// 监听音频元素变化
|
||||||
watch(() => player.value, (audioElement) => {
|
watch(() => player.value, (audioElement) => {
|
||||||
console.log('[Player] 音频元素 ref 变化:', !!audioElement)
|
|
||||||
if (audioElement && playQueueStore.list.length > 0) {
|
if (audioElement && playQueueStore.list.length > 0) {
|
||||||
console.log('[Player] 重新连接音频元素')
|
|
||||||
connectAudio(audioElement)
|
connectAudio(audioElement)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// 监听可视化器数据变化
|
// 监听可视化器数据变化
|
||||||
watch(() => barHeights.value, (newHeights) => {
|
watch(() => barHeights.value, (newHeights) => {
|
||||||
console.log('[Player] 可视化器数据更新:', newHeights.map(h => Math.round(h)))
|
|
||||||
playQueueStore.visualizer = newHeights
|
playQueueStore.visualizer = newHeights
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user