liushengqiang 2 роки тому
батько
коміт
38815077ab
1 змінених файлів з 6 додано та 5 видалено
  1. 6 5
      src/views/coursewarePlay/index.tsx

+ 6 - 5
src/views/coursewarePlay/index.tsx

@@ -74,7 +74,7 @@ export default defineComponent({
       const activeItem = data.itemList[popupData.activeIndex]
       if (activeItem.type != 'VIDEO') return
       if (value == 'hidden') {
-        isPlay.value = !activeItem.videoEle.paused
+        isPlay.value = !activeItem.videoEle?.paused
         togglePlay(activeItem, false)
       } else {
         // 页面显示,并且
@@ -557,10 +557,11 @@ export default defineComponent({
           activeData.isAnimation = true
           return
         }
-        if (
-          (item?.adviseStudyTimeSecond < 8 && index < nextIndex!) ||
-          (nextItem?.adviseStudyTimeSecond < 8 && index > nextIndex!)
-        ) {
+        const videoEle = item.videoEle
+        const nextVideo = nextItem.videoEle
+        if (videoEle && videoEle.duration < 8 && index < nextIndex!) {
+          activeData.isAnimation = false
+        } else if (nextVideo && nextVideo.duration < 8 && index > nextIndex!) {
           activeData.isAnimation = false
         } else {
           activeData.isAnimation = true