|
@@ -135,9 +135,13 @@ export const toggleMutePlayAudio = (source: IPlayState, muted: boolean) => {
|
|
|
/** 切换节拍器音源 */
|
|
|
export const changeSongSourceByBate = (isDisBate:boolean) => {
|
|
|
// isDisBate 为true 切换到不带节拍的,为false 切换到带节拍的
|
|
|
- const songEleCurrentTime = audioData.songEle?.currentTime || 0
|
|
|
- const backgroundEleCurrentTime = audioData.backgroundEle?.currentTime || 0
|
|
|
- const mingSongEleCurrentTime = audioData.mingSongEle?.currentTime || 0
|
|
|
+ let songEleCurrentTime = audioData.songEle?.currentTime || 0
|
|
|
+ let backgroundEleCurrentTime = audioData.backgroundEle?.currentTime || 0
|
|
|
+ let mingSongEleCurrentTime = audioData.mingSongEle?.currentTime || 0
|
|
|
+ // 有一种场景,默认模式没有文件内容的时候,songEle,backgroundEle,mingSongEle都为空,在设置音源之前点击跳转位置,这时候以audioData.progress的时间为准
|
|
|
+ if(!audioData.songEle&&!audioData.backgroundEle&&!audioData.mingSongEle){
|
|
|
+ songEleCurrentTime = backgroundEleCurrentTime = mingSongEleCurrentTime = audioData.progress || 0
|
|
|
+ }
|
|
|
if (isDisBate) {
|
|
|
if(state.playType === "play"){
|
|
|
audioData.songEle = audioData.songCollection.songEle
|