From 44e612361ccda654f26a22e782e78e636754ebf4 Mon Sep 17 00:00:00 2001 From: lixuefeng <1126141216@qq.com> Date: Tue, 15 Apr 2025 09:40:00 +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 | 7 +++---- src/views/hotel/components/info-box.vue | 2 +- src/views/scenic/index.vue | 17 ++++++++--------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/components/HlsPlayer/index.vue b/src/components/HlsPlayer/index.vue index 768a684..938b6b8 100644 --- a/src/components/HlsPlayer/index.vue +++ b/src/components/HlsPlayer/index.vue @@ -164,12 +164,12 @@ this.hls = new Hls({ // 内存优化配置 - maxBufferSize: 15 * 1000 * 1000, // 降低缓冲区大小(15MB) - maxBufferLength: 50, // 更小的缓冲窗口 + maxBufferSize: 0, // 降低缓冲区大小(15MB) + maxBufferLength: 0.1, // 更小的缓冲窗口 liveSyncDuration: 1, // 紧跟直播点 liveMaxLatencyDuration: 5, // 最大延迟5秒 liveDurationInfinity: true, - lowLatencyMode: false, // 启用低延迟模式 + lowLatencyMode: true, // 启用低延迟模式 maxMaxBufferLength: 60, backBufferLength: 1, // 减少保留的缓冲数据 manifestLoadingTimeOut: 10000, @@ -198,7 +198,6 @@ this.retryCount = 0 this.safePlay() }) - this.hls.on(Hls.Events.ERROR, (event, data) => { this.handleHlsError(data) }) diff --git a/src/views/hotel/components/info-box.vue b/src/views/hotel/components/info-box.vue index 103f0d2..0a218c1 100644 --- a/src/views/hotel/components/info-box.vue +++ b/src/views/hotel/components/info-box.vue @@ -71,7 +71,7 @@
- +
diff --git a/src/views/scenic/index.vue b/src/views/scenic/index.vue index f274b7b..84cda0d 100644 --- a/src/views/scenic/index.vue +++ b/src/views/scenic/index.vue @@ -29,6 +29,13 @@ (val) => { if (val[0] && val[1]) { sendMessage(JSON.stringify({ action: 'start', type: '', scenicSpotId: scenicSpotId.value })) + sendMessage( + JSON.stringify({ + action: 'start', + type: 'secureData', + scenicSpotId: scenicSpotId.value + }) + ) } }, { immediate: true } @@ -56,7 +63,6 @@ scenicStore.setScenicBearData(val) break case 'stopCarData': - console.log(val,'valvalvalvalvalvalval') scenicStore.setStopCarData(val) break case 'secureData': @@ -100,7 +106,6 @@ }, 20000) } const sendCarShip = (e) => { - timer = setInterval(() => { if (isConnected.value) { //车船数据 @@ -111,13 +116,7 @@ scenicSpotId: scenicSpotId.value }) ) //车窗数据 - sendMessage( - JSON.stringify({ - action: 'start', - type: 'secureData', - scenicSpotId: scenicSpotId.value - }) - ) + } }, 5000) }