Flex
2025-04-23 7d06faaf97996ae3227b0813b70338682005ac70
我得视频添加轮询
已修改1个文件
21 ■■■■■ 文件已修改
easegen-front/src/views/myCourse/index.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/myCourse/index.vue
@@ -534,6 +534,9 @@
const currentPlayUrl = ref('')
const videoRefs = ref<HTMLVideoElement[]>([])
//计时器
const Timer = ref()
// 获取视频列表
const getList = async () => {
  loading.value = true
@@ -1167,10 +1170,28 @@
  stopPolling()
})
//计时器轮询
const TimerList = ( () => {
  Timer.value = setInterval( ()=>{getList()}, 5000 )
} )
//清楚计时器
const ClearTimerList = ( () => {
  clearInterval(Timer.value)
  Timer.value = null
} )
// 初始化
onMounted(() => {
  //加载数据
  getList()
  //调用计时器
  TimerList()
})
//清楚计时器
onUnmounted( ()=>{
  ClearTimerList()
} )
// 播放预览
const playPreview = (type: 'titles' | 'trailer') => {