Răsfoiți Sursa

分屏云台修复

yanghao 2 zile în urmă
părinte
comite
226ca3aed2
1 a modificat fișierele cu 21 adăugiri și 9 ștergeri
  1. 21 9
      src/views/pms/video_center/sip/splitview.vue

+ 21 - 9
src/views/pms/video_center/sip/splitview.vue

@@ -73,7 +73,12 @@
                 v-else
                 v-else
                 :ref="(el) => setPlayerRef(el, i - 1)"
                 :ref="(el) => setPlayerRef(el, i - 1)"
                 :videourl="videoUrl[i - 1]"
                 :videourl="videoUrl[i - 1]"
-                :playerInfo="playInfoRes"
+                :playerInfo="
+                  playerInfo.filter(
+                    (item) =>
+                      videoUrl[i - 1]?.includes(item.id) && videoUrl[i - 1]?.includes(item.deviceId)
+                  )[0] || undefined
+                "
                 fluent
                 fluent
                 autoplay
                 autoplay
                 @screenshot="shot"
                 @screenshot="shot"
@@ -329,9 +334,9 @@ const sendDevicePush = (itemData, targetIndex = null) => {
     .then((response) => {
     .then((response) => {
       let res = response
       let res = response
       if (window.location.protocol === 'http:') {
       if (window.location.protocol === 'http:') {
-        itemData.playUrl = res.ws_flv
+        itemData.playUrl = res.playurl
       } else {
       } else {
-        itemData.playUrl = res.wss_flv
+        itemData.playUrl = playurl
       }
       }
       itemData.streamId = res.streamId
       itemData.streamId = res.streamId
       setPlayUrl(itemData.playUrl, playIndex) // 播放URL设置到指定位置
       setPlayUrl(itemData.playUrl, playIndex) // 播放URL设置到指定位置
@@ -348,13 +353,20 @@ const setPlayUrl = (url, idx) => {
   newVideoUrls[idx] = url
   newVideoUrls[idx] = url
   videoUrl.value = newVideoUrls
   videoUrl.value = newVideoUrls
 
 
-  playerInfo.value.forEach((item) => {
-    if (videoUrl.value[0].includes(item.id) && videoUrl.value[0].includes(item.deviceId)) {
-      playInfoRes.value = item
-    }
-  })
+  // playerInfo.value.forEach((item) => {
+  //   if (videoUrl.value[0].includes(item.id) && videoUrl.value[0].includes(item.deviceId)) {
+  //     playInfoRes.value = item
+  //   }
+  // })
+
+  // console.log('hhhhhhhhhhhhhhhhhhhhhhh', videoUrl.value)
 
 
-  console.log('hhhhhhhhhhhhhhhhhhhhhhh', videoUrl.value)
+  // console.log(
+  //   'xxxxxxxxxxxxxxxxxxxxx',
+  //   playerInfo.filter(
+  //     (item) => videoUrl[0].includes(item.id) && videoUrl[0].includes(item.deviceId)
+  //   )
+  // )
 
 
   setTimeout(() => {
   setTimeout(() => {
     window.localStorage.setItem('videoUrl', JSON.stringify(videoUrl.value))
     window.localStorage.setItem('videoUrl', JSON.stringify(videoUrl.value))