From 046aea0f559c9fc2e0eaec5f5ff4e1c37d051f91 Mon Sep 17 00:00:00 2001 From: lixuefeng <1126141216@qq.com> Date: Mon, 9 Feb 2026 12:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=9A=E5=BC=80=E5=8F=91?= =?UTF-8?q?=20=E6=8F=8F=E8=BF=B0=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/HlsPlayer/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/HlsPlayer/index.vue b/src/components/HlsPlayer/index.vue index 210f04e..019546c 100644 --- a/src/components/HlsPlayer/index.vue +++ b/src/components/HlsPlayer/index.vue @@ -160,10 +160,6 @@ initializePlayer() { if (!this.isActive || !this.url) return - // 如果是重新初始化播放器,先清理已存在的资源 - if (this.hls) { - this.immediateCleanup() - } if(this.url.startsWith('http://192.168.77.200:8050/')){ this.hls = new WebRTCWhep({ url: this.url, // WHEP 服务器地址 @@ -180,6 +176,10 @@ // this.initializePlayer(); }) }else{ + // 如果是重新初始化播放器,先清理已存在的资源 + if (this.hls) { + this.immediateCleanup() + } this.hls = new Hls({ // 内存优化配置 maxBufferSize: 0, // 降低缓冲区大小(15MB)