fix(Player): 修复播放状态未正确更新的问题
在播放下一首或上一首时,直接调用 `player.value?.play()` 可能会导致播放状态未正确更新。通过设置 `playQueueStore.isPlaying = true` 来确保播放状态同步更新。
This commit is contained in:
		
							parent
							
								
									3d47a6a774
								
							
						
					
					
						commit
						8c1957c6ee
					
				| 
						 | 
				
			
			@ -50,14 +50,14 @@ function playNext() {
 | 
			
		|||
		playQueueStore.isPlaying = false
 | 
			
		||||
	} else {
 | 
			
		||||
		playQueueStore.currentIndex++
 | 
			
		||||
		player.value?.play()
 | 
			
		||||
		playQueueStore.isPlaying = true
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function playPrevious() {
 | 
			
		||||
	if (player.value && (player.value.currentTime ?? 0) < 5 && playQueueStore.currentIndex > 0) {
 | 
			
		||||
		playQueueStore.currentIndex--
 | 
			
		||||
		player.value?.play()
 | 
			
		||||
		playQueueStore.isPlaying = true
 | 
			
		||||
	} else {
 | 
			
		||||
		if (player.value) { player.value.currentTime = 0 }
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user