From ef01ef839455e9986ae8c04a16b19a5819d67ae8 Mon Sep 17 00:00:00 2001 From: Ironsp <1522278303@qq.com> Date: Wed, 22 Jul 2026 14:26:34 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/notice/index.vue | 2 +- src/utils/video.ts | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/layout/components/notice/index.vue b/src/layout/components/notice/index.vue index 6eab56b..e938d2a 100644 --- a/src/layout/components/notice/index.vue +++ b/src/layout/components/notice/index.vue @@ -189,7 +189,7 @@ watch( (newNotices) => { const filteredNotices = [...newNotices].map(parseNoticeItem); newsList.value = filteredNotices; - console.log('监听消息队列', newsList.value); + // console.log('监听消息队列', newsList.value); }, { deep: true } ); diff --git a/src/utils/video.ts b/src/utils/video.ts index a165037..f5e6b28 100644 --- a/src/utils/video.ts +++ b/src/utils/video.ts @@ -122,22 +122,23 @@ export const initHls = (monitorVideoUrl, monitorVideoRef, isDialogVisible?: () = switch (data.type) { case Hls.ErrorTypes.NETWORK_ERROR: if (data.details === 'manifestLoadError' || data.details === 'manifestLoadTimeOut') { - console.error('网络错误'); + //console.error('网络错误'); + ElMessage.error('网络错误,请检查网络连接'); // if (onStall) { // onStall(); // } hls.startLoad(); } else { - console.warn('[HLS] 网络错误,自动恢复...'); + ElMessage.error('[HLS] 网络错误,自动恢复...'); hls.startLoad(); } break; case Hls.ErrorTypes.MEDIA_ERROR: - console.warn('[HLS] 媒体解码错误,尝试恢复...'); + ElMessage.error('[HLS] 媒体解码错误,尝试恢复...'); hls.recoverMediaError(); break; default: - console.error('[HLS] 不可恢复的错误,销毁实例'); + ElMessage.error('[HLS] 不可恢复的错误,销毁实例'); state.destroyed = true; stopLiveSync(state); hls.destroy(); @@ -152,18 +153,18 @@ export const initHls = (monitorVideoUrl, monitorVideoRef, isDialogVisible?: () = case Hls.ErrorTypes.NETWORK_ERROR: // 分片加载失败等 → 重新加载 if (data.details === 'fragLoadError' || data.details === 'fragLoadTimeOut') { - console.warn(`[HLS] 分片加载问题 (${data.details}),第 ${state.consecutiveFailures} 次失败,尝试恢复...`); + ElMessage.error(`[HLS] 分片加载问题 (${data.details}),第 ${state.consecutiveFailures} 次失败,尝试恢复...`); hls.startLoad(hls.currentLevel); } break; case Hls.ErrorTypes.MEDIA_ERROR: if (data.details === 'bufferAppendError' || data.details === 'bufferFullError') { - console.warn(`[HLS] 缓冲区问题 (${data.details}),尝试恢复...`); + ElMessage.error(`[HLS] 缓冲区问题 (${data.details}),尝试恢复...`); hls.recoverMediaError(); } break; default: - console.warn(`[HLS] 非致命错误: ${data.type} - ${data.details}`); + ElMessage.error(`[HLS] 非致命错误: ${data.type} - ${data.details}`); break; } } @@ -176,7 +177,7 @@ export const initHls = (monitorVideoUrl, monitorVideoRef, isDialogVisible?: () = state.stallTimer = setInterval(() => { if (state.destroyed || !onStall) return; if (state.consecutiveFailures >= 3) { - console.warn(`[HLS] 连续 ${state.consecutiveFailures} 次加载失败,触发自动刷新`); + ElMessage.error(`[HLS] 连续 ${state.consecutiveFailures} 次加载失败,触发自动刷新`); state.consecutiveFailures = 0; onStall(); }