瀏覽代碼

Merge branch 'gyt-feature-tianyong' into gyt-test

TIANYONG 11 月之前
父節點
當前提交
2c4392c3bd
共有 3 個文件被更改,包括 14 次插入7 次删除
  1. 11 0
      src/pages/detail/runtime.ts
  2. 1 0
      src/subpages/colexiu/buttons/index.tsx
  3. 2 7
      src/subpages/colexiu/buttons/player.tsx

+ 11 - 0
src/pages/detail/runtime.ts

@@ -302,6 +302,17 @@ export const changeAllMode = () => {
   }
 }
 
+// 重置播放倍率
+export const resetBaseRate = () => {
+  const currentItem: any = detailState.times[0];
+  const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : detailState.baseSpeed;
+  state.speed = currentSpeed
+  state.playIngSpeed = currentSpeed
+  state.activeIndex = 0
+  state.basePlayRate = 1;
+  changeSpeed(currentSpeed)
+}
+
 export const changeSpeed = (speed: number, isSave: boolean = true) => {
   // console.log('速度设置',speed,isSave)
   // const route: any = router.currentRoute.value

+ 1 - 0
src/subpages/colexiu/buttons/index.tsx

@@ -258,6 +258,7 @@ export default defineComponent({
                     runtime.evaluatingStatus = false
                     evaluatStopPlay()
                   }
+                  RuntimeUtils.resetBaseRate();
                   modelType.value = 'init'
                 }}
               >

+ 2 - 7
src/subpages/colexiu/buttons/player.tsx

@@ -14,13 +14,8 @@ export default defineComponent({
     const [wiredStatus] = useWiredHeadsetCheck()
 
     const reset = () => {
-      const currentItem: any = detailState.times[0];
-      const currentSpeed = currentItem?.measureSpeed ? currentItem.measureSpeed : detailState.baseSpeed;
-      runtime.speed = currentSpeed
-      runtime.playIngSpeed = currentSpeed
-      runtime.activeIndex = 0
-      runtime.basePlayRate = 1;
-      RuntimeUtils.changeSpeed(currentSpeed)
+      // 重置播放倍率
+      RuntimeUtils.resetBaseRate();
       if (detailState.activeTick > -1) {
         return
       }