feat:对接全屏弹框

This commit is contained in:
张先生
2025-03-18 20:32:13 +08:00
parent f64c745064
commit a955e27665
5 changed files with 53 additions and 12 deletions

View File

@@ -211,13 +211,15 @@
})
let hlsRefs = []
let hlsRef = null
// const postVideoRemain = async () => {
// setInterval(() => {
// postVideoRemainApi({
// cameraIndexCode: videoList.value.map((item) => item.cameraIndexCode)
// })
// }, 3000)
// }
let timer = null
const postVideoRemain = async () => {
timer = setInterval(() => {
postVideoRemainApi({
cameraIndexCode: videoList.value.map((item) => item.cameraIndexCode)
})
}, 3000)
}
const initVideo = () => {
clearHlsRefs()
@@ -337,6 +339,7 @@
let res = await getVideoListApi(params)
total.value = res.total
if (res.data.length > 0) {
postVideoRemain()
videoList.value = res.data
nextTick(() => {
videoList.value.forEach(async (x, index) => {
@@ -354,6 +357,8 @@
hlsRefs.push(hls)
})
})
} else {
if (timer) clearInterval(timer)
}
loading.value = false
} catch (error) {
@@ -398,6 +403,7 @@
})
onUnmounted(() => {
clearHlsRefs()
if (timer) clearInterval(timer)
pubSub.unsubscribe(monitorChange)
})
</script>