From 03f9c0bee1f58b5ef994c178446f8346b9e97e12 Mon Sep 17 00:00:00 2001 From: kun <1422840143@qq.com> Date: Thu, 26 Oct 2023 11:19:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../huizhou/siteSupervision/videoMonitoring/index.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/views/goverment/huizhou/siteSupervision/videoMonitoring/index.vue b/src/views/goverment/huizhou/siteSupervision/videoMonitoring/index.vue index 0e437b2..d761913 100644 --- a/src/views/goverment/huizhou/siteSupervision/videoMonitoring/index.vue +++ b/src/views/goverment/huizhou/siteSupervision/videoMonitoring/index.vue @@ -257,6 +257,7 @@ const playVideo = async () => { // do you want... } ); + dataIndex.value = dataIndex.value + 1; }; // 获取视频流 const getVideo = async () => { @@ -272,10 +273,9 @@ const getVideo = async () => { }, 200); const res = await getpreviewURL({ cameraIndexCode: cameraIndexCode.value, protocol: "ws" }); playUrl.value = res.result; - await playVideo(); - let changeVal = dataIndex.value - 1; // 由于上一个方法已经对dataIndex.value + 1,所以需要-1 - videoList.value[changeVal].videoUrl = res.result; + videoList.value[videoList.value.length - 1].videoUrl = res.result; console.log(res); + await playVideo(); }; const BeginPlayer = (id: any) => { console.log(id); @@ -293,8 +293,7 @@ const BeginPlayer = (id: any) => { iCurrentSplit: 1, openDebug: true }); - videoList.value[dataIndex.value].pluginValue = myPlugin.value; - dataIndex.value++; + videoList.value[videoList.value.length - 1].pluginValue = myPlugin.value; }; const changeTreeFilter = async (item: { data: { code: string | null; title: any; children: any[] };