diff --git a/dist417大屏.zip b/dist417大屏.zip new file mode 100644 index 0000000..45ff8c0 Binary files /dev/null and b/dist417大屏.zip differ diff --git a/src/api/home.js b/src/api/home.js index 7552a78..17e8777 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -15,6 +15,22 @@ export function getColletListApi(data) { data }) } +// 自定义视频列表 +export function getColletDiyListApi(data) { + return request({ + url: '/fjtcc-api/api/largeScreen/video/diyList', + method: 'post', + data + }) +} +// 自定义视频列表收藏 +export function getColletDiyApi(data) { + return request({ + url: '/fjtcc-api/api/largeScreen/video/diy', + method: 'get', + params: data + }) +} // 核心景区视频 export function getVideoListApi(data) { return request({ diff --git a/src/components/HlsPlayer/index.vue b/src/components/HlsPlayer/index.vue index db680d0..8689e22 100644 --- a/src/components/HlsPlayer/index.vue +++ b/src/components/HlsPlayer/index.vue @@ -75,7 +75,7 @@ immediate: true }, url(newUrl) { - console.log(newUrl,'77777777777777777777777777777777') + // console.log(newUrl,'77777777777777777777777777777777') if (newUrl && this.isActive) { this.initializePlayer() } @@ -162,7 +162,6 @@ if (this.hls) { this.immediateCleanup() } - this.hls = new Hls({ // 内存优化配置 maxBufferSize: 0, // 降低缓冲区大小(15MB) @@ -200,6 +199,12 @@ this.safePlay() }) this.hls.on(Hls.Events.ERROR, (event, data) => { + console.log('核心视频错误',data.type) + // this.hls.startLoad(); //重连 + if (data.type === Hls.ErrorTypes.BUFFER_STALLED_ERROR) { + console.error('缓冲停滞错误,尝试重新加载视频'); + this.hls.startLoad(); // 尝试重新加载视频 + } this.handleHlsError(data) }) @@ -207,7 +212,31 @@ this.cleanupNetworkResources() }) }, - + initVideo() { + this.beforeDestroy() + this.hls = new Hls({ + maxBufferLength: 30, // 最大缓冲长度(秒) + maxMaxBufferLength: 15, // 缓冲区长度的上限 + maxBufferSize: 30 * 1000 * 1000 // 最大缓冲大小(字节) + }) + this.hls.attachMedia(this.video) + this.hls.loadSource(this.url) + + // 事件处理 + this.hls.on(Hls.Events.MANIFEST_PARSED, () => { + this.loading = false + this.retryCount = 0 + this.safePlay() + }) + this.hls.on(Hls.Events.ERROR, (event, data) => { + this.hls.startLoad(); //重连 + this.handleHlsError(data) + }) + + this.hls.on(Hls.Events.BUFFER_EOS, () => { + this.cleanupNetworkResources() + }) + }, cleanupNetworkResources() { // 清理已播放的缓冲数据 if (this.hls && this.video) { diff --git a/src/components/Line/index.vue b/src/components/Line/index.vue index 4b63b80..356b0e5 100644 --- a/src/components/Line/index.vue +++ b/src/components/Line/index.vue @@ -1,11 +1,16 @@ - + diff --git a/src/layout/components/CoreVideo/index.vue b/src/layout/components/CoreVideo/index.vue index dfed669..44acbd1 100644 --- a/src/layout/components/CoreVideo/index.vue +++ b/src/layout/components/CoreVideo/index.vue @@ -62,6 +62,7 @@ } ) + let isCollect = ref(0) let list = ref([]) let src = ref('') @@ -84,7 +85,7 @@ let isCollect = ref(0) postVideoRemainApi({ cameraIndexCode: list.value.map((item) => item.cameraIndexCode) }) - }, 4000) + }, 1500) } const getPreviewUrl = async (code) => { @@ -101,13 +102,8 @@ let isCollect = ref(0) pageSize: 5 }) list.value = res.data - if(list.value.length){ - postVideoRemain() - }else{ - console.log('清除定时器') - //清除定时器 - if (timer) clearInterval(timer) - } + postVideoRemain() + if (timer) clearInterval(timer) // console.log(list.value,'list.valuelist.valuelist.valuelist.value') // nextTick(() => { // list.value.forEach(async (item, index) => { @@ -129,7 +125,14 @@ let isCollect = ref(0) // }) // }) } - + watch( + () => list.value, + (val) => { + if(val.length){ + postVideoRemain() + } + } + ) // 释放hls实例 const clearHlsRefs = () => { if (hlsRefs.length > 0) { diff --git a/src/layout/components/Correspondence/index.vue b/src/layout/components/Correspondence/index.vue index 620b5a3..69e633c 100644 --- a/src/layout/components/Correspondence/index.vue +++ b/src/layout/components/Correspondence/index.vue @@ -64,6 +64,14 @@ + +
+
+ + +
+
+
@@ -71,6 +79,7 @@ import { getComDeptsApi, getComDeptUsersApi, getComRecordApi } from '@/api/common' let deptsList = ref([]) let dialogTableVisible = ref(false) + let dialogTableVisible2 = ref(false) const getComDepts = async () => { let res = await getComDeptsApi() deptsList.value = res.data @@ -83,7 +92,8 @@ let gridData = ref([]) let gridTitle = ref('') const goItc = () => { - location.href="http://192.168.0.2:81/"; + dialogTableVisible2.value = true + // location.href="http://192.168.0.2:81/"; } const handleDepsUser = async (id, item) => { gridTitle.value = item.name @@ -99,6 +109,13 @@ + diff --git a/src/views/scenic/components/big-map.vue b/src/views/scenic/components/big-map.vue index f11a808..5624726 100644 --- a/src/views/scenic/components/big-map.vue +++ b/src/views/scenic/components/big-map.vue @@ -8,33 +8,45 @@