Browse Source

修复最后一个视频播完卡死

liushengqiang 2 years ago
parent
commit
8419fdabed
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/views/coursewarePlay/index.tsx

+ 2 - 1
src/views/coursewarePlay/index.tsx

@@ -543,7 +543,8 @@ export default defineComponent({
     const acitveTimer = ref()
     // 轮播切换
     const handleSwipeChange = (index: number) => {
-      if (popupData.activeIndex == index) return
+      // 如果是当前正在播放 或者是视频最后一个
+      if (popupData.activeIndex == index || index === (data.itemList.length - 1)) return
       handleStop()
       clearTimeout(acitveTimer.value)
       const oldIndex = popupData.activeIndex