Ver Fonte

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

liushengqiang há 2 anos atrás
pai
commit
8419fdabed
1 ficheiros alterados com 2 adições e 1 exclusões
  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