浏览代码

fix: 选段重播bug

TIANYONG 1 年之前
父节点
当前提交
104353e05e
共有 1 个文件被更改,包括 6 次插入9 次删除
  1. 6 9
      src/state.ts

+ 6 - 9
src/state.ts

@@ -555,6 +555,7 @@ const handlePlaying = () => {
 
       // if (Math.abs(selectEndItem.endtime - currentTime) < offset_duration) {
         // if (currentTime - selectEndItem.endtime > offset_duration) {
+          console.log(currentTime,selectEndItem.endtime)
         if (currentTime - selectEndItem.endtime >= 0) {
         console.log("选段播放结束",state.setting.repeatAutoPlay);
         // 如果为选段评测模式
@@ -817,14 +818,10 @@ export const handleChangeSection = () => {
 const formateSelectMearure = (_list: any[]): any[] => {
   if (!_list.length) return [];
   const list = _list.sort((a, b) => a.time - b.time);
-  /**
-   * bug: #9860
-   * measureOpenIndex替换为MeasureNumberXML匹配
-   */
-  const startXml = list[0]?.MeasureNumberXML;
-  const endXml = list.last()?.MeasureNumberXML;
-  const selectStartMeasure = state.times.filter((n: any) => startXml === n.MeasureNumberXML) || [];
-  const selectEndMeasure = state.times.filter((n: any) => endXml === n.MeasureNumberXML) || [];
+  const startXml = list[0]?.measureOpenIndex;
+  const endXml = list.last()?.measureOpenIndex;
+  const selectStartMeasure = state.times.filter((n: any) => startXml === n.measureOpenIndex) || [];
+  const selectEndMeasure = state.times.filter((n: any) => endXml === n.measureOpenIndex) || [];
   // 没有找到选段小节
   if (!selectStartMeasure.length || !selectEndMeasure.length) {
     clearSelection();
@@ -915,7 +912,7 @@ export const hanldeDirectSelection = (list: any[]) => {
   state.sectionStatus = true;
   setTimeout(() => {
     state.section = formateSelectMearure(list);
-    //console.log(333333333,state.section)
+    // console.log(333333333,state.section)
   }, 500);
 };
 let offsetTop = 0;