Browse Source

做个保护

harry 1 năm trước cách đây
mục cha
commit
d222e9617d
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      src/components/VideoSwiper/index.tsx

+ 3 - 0
src/components/VideoSwiper/index.tsx

@@ -100,6 +100,9 @@ export default function VideoSwiper({ list, onFinish, needResumePlay, flushList,
 
         if (activeIndex == current) {
             onFinish(currentListIndex)
+            if (!circular && virualListIndex < list.length - 1){
+                setCircular(true)
+            }
             return
         }
         activeIndex = current