Explorar o código

调速之后 的唱名播放进度问题

黄琪勇 hai 11 meses
pai
achega
70c10e591a
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/view/audio-list/index.tsx

+ 7 - 1
src/view/audio-list/index.tsx

@@ -147,7 +147,13 @@ export const toggleMutePlayAudio = (source: IPlayState, muted: boolean) => {
 /** 切换节拍器音源 */
 export const changeSongSourceByBate = (isDisBate:boolean) => {
 	// isDisBate 为true 切换到不带节拍的,为false 切换到带节拍的
-	const currentTime = audioData.songEle?.currentTime || audioData.backgroundEle?.currentTime || audioData.mingSongEle?.currentTime || audioData.progress || 0
+	let currentTime
+	if(state.playSource === "mingSong"){
+		currentTime = audioData.mingSongEle?.currentTime
+	}else{
+		currentTime = audioData.songEle?.currentTime || audioData.backgroundEle?.currentTime
+	}
+	currentTime || (currentTime = audioData.progress || 0)
 	if (isDisBate) {
 		if(state.playType === "play"){
 			audioData.songEle = audioData.songCollection.songEle