Browse Source

feat: 选段模式兼容音频时长比xml时值短的情况

TIANYONG 2 weeks ago
parent
commit
037e435b1a
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/state.ts

+ 2 - 1
src/state.ts

@@ -528,7 +528,8 @@ const handlePlaying = () => {
       // 如果开启了预备拍
       const selectStartItem = state.sectionFirst ? state.sectionFirst : state.section[0];
       const selectEndItem = state.section[1];
-      if (currentTime - selectEndItem.endtime >= 0) {
+      // 如果选段播放结束,或者音频播放结束(判断条件:currentTime >= duration)
+      if ( (currentTime - selectEndItem.endtime >= 0) || (currentTime >= duration) ) {
         console.log("选段播放结束", state.setting.repeatAutoPlay);
         // 如果为选段评测模式
         if (state.modeType === "evaluating" && state.isSelectMeasureMode) {