diff --git a/src/components/CoreVideo/index.vue b/src/components/CoreVideo/index.vue index 9104b67..29005c9 100644 --- a/src/components/CoreVideo/index.vue +++ b/src/components/CoreVideo/index.vue @@ -10,11 +10,13 @@ :key="index" @click="handleItem(item)" > -
+ +
取消关注
+
@@ -65,25 +67,25 @@ pageSize: 5 }) list.value = res.data - nextTick(() => { - list.value.forEach(async (item, index) => { - var video = document.getElementById(`video${index}`) - const hls = new Hls({ - enableWorker: false, // 禁用 Worker 来避免额外的线程 - enableSoftwareAES: true, // 使用软件解码器以避免硬件解码的额外请求 - cache: true, // 启用缓存 - maxBufferLength: 10, // 最大缓冲长度(秒) - maxMaxBufferLength: 15, // 缓冲区长度的上限 - maxBufferSize: 20 * 1000 * 1000 // 最大缓冲大小(字节) - }) - hls.loadSource(item.hlsUrl) - hls.attachMedia(video) - hls.on(Hls.Events.MANIFEST_PARSED, () => { - video.play() - }) - hlsRefs.push(hls) - }) - }) + // nextTick(() => { + // list.value.forEach(async (item, index) => { + // var video = document.getElementById(`video${index}`) + // const hls = new Hls({ + // enableWorker: false, // 禁用 Worker 来避免额外的线程 + // enableSoftwareAES: true, // 使用软件解码器以避免硬件解码的额外请求 + // cache: true, // 启用缓存 + // maxBufferLength: 10, // 最大缓冲长度(秒) + // maxMaxBufferLength: 15, // 缓冲区长度的上限 + // maxBufferSize: 20 * 1000 * 1000 // 最大缓冲大小(字节) + // }) + // hls.loadSource(item.hlsUrl) + // hls.attachMedia(video) + // hls.on(Hls.Events.MANIFEST_PARSED, () => { + // video.play() + // }) + // hlsRefs.push(hls) + // }) + // }) } // 释放hls实例 @@ -177,6 +179,7 @@ } .item { + position: relative; margin-bottom: vh(10); padding: vw(10); background-size: 100% 100%; @@ -186,11 +189,11 @@ position: absolute; right: vw(4); top: vw(4); - z-index: 99; + z-index: 99999; width: vw(64); - height: vh(24); + height: vw(30); text-align: center; - line-height: vh(24); + line-height: vw(30); font-weight: 400; font-size: vw(12); color: #ffffff; @@ -202,10 +205,6 @@ display: block; } } - & > div { - position: relative; - } - &-title { position: absolute; bottom: 0; diff --git a/src/components/HlsPlayer/index.vue b/src/components/HlsPlayer/index.vue new file mode 100644 index 0000000..3722b6f --- /dev/null +++ b/src/components/HlsPlayer/index.vue @@ -0,0 +1,325 @@ + + + + + diff --git a/src/components/VideoDialog/index.vue b/src/components/VideoDialog/index.vue index 64a41d4..2621865 100644 --- a/src/components/VideoDialog/index.vue +++ b/src/components/VideoDialog/index.vue @@ -8,11 +8,13 @@ :z-index="9999" destroy-on-close > -
-
@@ -71,19 +72,19 @@ let webRtcServer = null let hlsRef = null - watch( - () => modelValue.value, - (val) => { - if (val) { - setTimeout(() => { - init() - }, 1000) - } - }, - { - immediate: true - } - ) + // watch( + // () => modelValue.value, + // (val) => { + // if (val) { + // setTimeout(() => { + // init() + // }, 1000) + // } + // }, + // { + // immediate: true + // } + // ) const handleAction = async (e) => { if (e == STOP) { @@ -106,8 +107,10 @@ }) } const handleClose = () => { - hlsRef.destroy() - hlsRef = null + if (hlsRef) { + hlsRef.destroy() + hlsRef = null + } modelValue.value = false } const init = () => { @@ -179,6 +182,8 @@ position: absolute; left: 50%; top: 50%; + width: vw(1814); + height: vw(980); color: #fff; font-weight: bold; font-size: vw(30); diff --git a/src/views/monitor/components/box-2.vue b/src/views/monitor/components/box-2.vue index 202594c..2d46286 100644 --- a/src/views/monitor/components/box-2.vue +++ b/src/views/monitor/components/box-2.vue @@ -21,14 +21,20 @@ +
- + {{ item.regions }}
-
- +
+
{ - // return { - // ...i, - // label: i.regions, - // children: i.videoResources.map((x) => { - // return { - // ...x, - // label: x.cameraName || x.cameraIndexCode, - // children: [] - // } - // }) - // } - // }) } } const onMonitorChange = () => { @@ -517,7 +514,7 @@ cursor: pointer; position: relative; padding-top: vh(20); - border-left: vw(2) solid #37d8fc; + // border-left: vw(2) solid #37d8fc; &:nth-child(1) { padding-top: 0; } @@ -529,7 +526,11 @@ &__icon { margin-left: vw(-8); width: vw(16); - height: vw(16); + height: auto; + } + &__icon-up { + @extend .tree-item__icon; + transform: rotate(180deg); } &__name { padding: 0 vw(20); @@ -544,8 +545,8 @@ &__child { position: relative; margin-top: vh(20); - margin-left: vw(40); - border-left: vw(2) solid #37d8fc; + margin-left: vw(20); + // border-left: vw(2) solid #37d8fc; } &-top__icon { position: absolute; @@ -562,17 +563,16 @@ height: vw(16); } &__child-item { - cursor: pointer; padding: vh(0) vw(20) vh(20) vw(20); - display: block; + cursor: pointer; + color: #999; font-weight: 400; font-size: vw(15); - display: flex; - align-items: flex-start; - color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + display: flex; + align-items: flex-start; &:nth-last-of-type(1) { padding: vh(0) vw(20); }