From 97d8b8e6b6c62cd3bc6097353e409138bc05f3cf Mon Sep 17 00:00:00 2001 From: senshinya <155552943+senshinya@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:58:31 +0800 Subject: [PATCH] fix: try to fix stall --- src/app/play/page.tsx | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/app/play/page.tsx b/src/app/play/page.tsx index 47d9ffe..b57e798 100644 --- a/src/app/play/page.tsx +++ b/src/app/play/page.tsx @@ -1195,24 +1195,6 @@ function PlayPageClient() { // 调用父类构造函数 // @ts-ignore super(config); - - // 监听 Hls 错误事件,捕获 bufferStalledError 并尝试跳过 - this.on(Hls.Events.ERROR, (_evt: any, data: any) => { - if ( - data?.details === Hls.ErrorDetails.BUFFER_STALLED_ERROR || - data?.details === Hls.ErrorDetails.BUFFER_SEEK_OVER_HOLE - ) { - try { - const media = (this as any).media as HTMLMediaElement | undefined; - if (media && !media.seeking) { - // 前跳 1 秒,跳过当前卡顿的分片 - media.currentTime = media.currentTime + 1; - } - } catch (err) { - console.warn('尝试跳过卡顿分片失败:', err); - } - } - }); } attachMedia(media: HTMLMediaElement): void {