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[] };