소스 검색

播放结束之后 回到初始位置

黄琪勇 1 년 전
부모
커밋
36c7cf8f5a
3개의 변경된 파일24개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/views/creation/index-share.tsx
  2. 8 0
      src/views/creation/index.tsx
  3. 8 0
      src/views/creation/playCreation/index.tsx

+ 8 - 0
src/views/creation/index-share.tsx

@@ -198,6 +198,14 @@ export default defineComponent({
         plyrState.playIngShow = true
         pauseStaff()
       });
+      player.on('ended', () => {
+        player.currentTime = 0
+        if(!player.playing){
+          setTimeout(() => {
+            updateProgressStaff(player.currentTime)
+          }, 100);
+        }
+      });
       // 处理按压事件
       const handleStart = () => {
         plyrState.duration = player.duration

+ 8 - 0
src/views/creation/index.tsx

@@ -228,6 +228,14 @@ export default defineComponent({
         plyrState.playIngShow = true
         pauseStaff()
       });
+      player.on('ended', () => {
+        player.currentTime = 0
+        if(!player.playing){
+          setTimeout(() => {
+            updateProgressStaff(player.currentTime)
+          }, 100);
+        }
+      });
       // 处理按压事件
       const handleStart = () => {
         plyrState.duration = player.duration

+ 8 - 0
src/views/creation/playCreation/index.tsx

@@ -74,6 +74,14 @@ export default defineComponent({
         playIngShow.value = true
         pauseStaff()
       });
+      _plrl.on('ended', () => {
+        _plrl.currentTime = 0
+        if(!_plrl.playing){
+          setTimeout(() => {
+            updateProgressStaff(_plrl.currentTime)
+          }, 100);
+        }
+      });
       _plrl.on('seeked', () => {
         // 暂停的时候调用
         if(!_plrl.playing){