qinpeng 2 роки тому
батько
коміт
d47734f5cc
1 змінених файлів з 34 додано та 18 видалено
  1. 34 18
      src/components/Adult/preview/Voicefullscreen.vue

+ 34 - 18
src/components/Adult/preview/Voicefullscreen.vue

@@ -1483,6 +1483,10 @@ export default {
         that.LY_regionData = null;
         that.ly_ShowcurentTime = "00:00";
         wavesurfer_ly.clearRegions();
+        wavesurfer_ly.enableDragSelection({
+          color: "rgba(255, 255, 255, 0.2)",
+        });
+
         // that.initLYaudioImage(that.speedList[that.speedIndex], false);
       }
     },
@@ -1493,6 +1497,9 @@ export default {
         that.regionData = null;
         that.ShowcurentTime = "00:00";
         that.wavesurfer_big.clearRegions();
+        that.wavesurfer_big.enableDragSelection({
+          color: "rgba(255, 255, 255, 0.2)",
+        });
         // that.initaudioImage(that.speedList[that.speedIndex], false);
       }
     },
@@ -1531,23 +1538,23 @@ export default {
         }),
         Regions.create({}),
       ];
-      if (this.regionData) {
-        plugin.splice(plugin.length - 1, 1);
-        plugin.push(
-          Regions.create({
-            regions: [
-              {
-                start: this.regionData.start,
-                end: this.regionData.end,
-                loop: false,
-                drag: false,
-                resize: false,
-                color: "rgba(255, 255, 255, 0.2)",
-              },
-            ],
-          })
-        );
-      }
+      // if (this.regionData) {
+      //   plugin.splice(plugin.length - 1, 1);
+      //   plugin.push(
+      //     Regions.create({
+      //       regions: [
+      //         {
+      //           start: this.regionData.start,
+      //           end: this.regionData.end,
+      //           loop: false,
+      //           drag: false,
+      //           resize: false,
+      //           color: "rgba(255, 255, 255, 0.2)",
+      //         },
+      //       ],
+      //     })
+      //   );
+      // }
       this.wavesurfer_big = WaveSurfer.create({
         container: this.$refs.waveform_big,
         audioRate: audioRate ? audioRate : 1,
@@ -1571,7 +1578,16 @@ export default {
           loop: false,
           drag: false,
           resize: false,
-          // color: "rgba(254, 255, 255, 0.4)",
+          color: "rgba(255, 255, 255, 0.2)",
+        });
+      } else {
+        this.wavesurfer_big.addRegion({
+          start: this.regionData.start,
+          end: this.regionData.end,
+          loop: false,
+          drag: false,
+          resize: false,
+          color: "rgba(255, 255, 255, 0.2)",
         });
       }