From 7f376ce10cb2b4f63ac5397317f07ecd8206341b Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Mon, 20 Jul 2026 10:22:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=20hls=E5=88=86=E7=89=87=E5=8A=A0=E5=9C=A8?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc-auto-import.json | 4 ---- src/utils/video.ts | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index d979925..2ca3adf 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -5,10 +5,6 @@ "ComputedRef": true, "DirectiveBinding": true, "EffectScope": true, - "ElLoading": true, - "ElMessage": true, - "ElMessageBox": true, - "ElNotification": true, "ExtractDefaultPropTypes": true, "ExtractPropTypes": true, "ExtractPublicPropTypes": true, diff --git a/src/utils/video.ts b/src/utils/video.ts index 365986e..3e366af 100644 --- a/src/utils/video.ts +++ b/src/utils/video.ts @@ -46,6 +46,12 @@ export const initHls = (monitorVideoUrl, monitorVideoRef, isDialogVisible?: () = switch (data.type) { case Hls.ErrorTypes.NETWORK_ERROR: hls.startLoad(); + hls.once(Hls.Events.FRAG_LOADED, () => { + //分片加载成功后播放 + try { + video.play().catch(() => {}); + } catch (e) {} + }); ElMessage.error('网络错误, 请检查网络或重试'); break; case Hls.ErrorTypes.MEDIA_ERROR: