From dacd296f0a783c242554eb4b93ff5801b5969972 Mon Sep 17 00:00:00 2001 From: zy <82248909@qq.com> Date: Sat, 20 Dec 2025 17:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/appmana/liveCamra/MonitorModal.vue | 161 ++++++++++--------- src/views/appmana/liveCamra/index.vue | 2 + 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/src/views/appmana/liveCamra/MonitorModal.vue b/src/views/appmana/liveCamra/MonitorModal.vue index e0a0a09..f83645a 100644 --- a/src/views/appmana/liveCamra/MonitorModal.vue +++ b/src/views/appmana/liveCamra/MonitorModal.vue @@ -68,89 +68,96 @@ function statistic(record) { if(camType.value == 'ball' || camType.value === 'halfball') { width.value = 1000; } - if(record.deviceIotUrl && record.deviceIotUrl != ''){ - let videohtml = - `
` - nextTick(() => { - let dom = document.querySelector('#parent2') - dom.innerHTML = videohtml - player.value = new EZUIKit.EZUIKitPlayer({ - id: 'videos', // 视频容器ID - accessToken: record.ysToken, - url: record.deviceIotUrl, - audio: 0, - autoplay: true, - // simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版; - template: 'security', - // themeData: this.themeData, - plugin: ['expend'], // 加载插件,talk-对讲 - height: 600, - showStreamInfo:false, + if(record.isRewind) { + if(record.deviceReverseIotUrl && record.deviceReverseIotUrl != ''){ + let videohtml = + `
` + nextTick(() => { + let dom = document.querySelector('#parent2') + dom.innerHTML = videohtml + player.value = new EZUIKit.EZUIKitPlayer({ + id: 'videos', // 视频容器ID + accessToken: record.ysToken, + url: record.deviceReverseIotUrl, + audio: 0, + autoplay: true, + // simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版; + template: 'security', + // themeData: this.themeData, + plugin: ['expend'], // 加载插件,talk-对讲 + height: 600, + showStreamInfo:false, + }) + playerType.value = 'ys'; + + const videosWrap = document.getElementById('videos-wrap'); + videosWrap.style.height = '100%'; }) - playerType.value = 'ys'; + } + }else{ - const videosWrap = document.getElementById('videos-wrap'); - videosWrap.style.height = '100%'; - }) - }else if(record.deviceUrl && record.deviceUrl !=''){ - let video = document.createElement('video'); - video.id = `videos`; - video.className = `video-js example-video vjs-default-skin vjs-big-play-centered`; - video.autoplay = 'autoplay'; - video.controls = 'controls'; - video.style = `object-fit: fill;width:100%;height:100%`; - video.preload = `auto`; - video.muted = `muted`; + if(record.deviceIotUrl && record.deviceIotUrl != ''){ + let videohtml = + `
` + nextTick(() => { + let dom = document.querySelector('#parent2') + dom.innerHTML = videohtml + player.value = new EZUIKit.EZUIKitPlayer({ + id: 'videos', // 视频容器ID + accessToken: record.ysToken, + url: record.deviceIotUrl, + audio: 0, + autoplay: true, + // simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版; + template: 'security', + // themeData: this.themeData, + plugin: ['expend'], // 加载插件,talk-对讲 + height: 600, + showStreamInfo:false, + }) + playerType.value = 'ys'; - nextTick(() => { - let dom = document.querySelector('#parent2') - dom.innerHTML = '';//先清空 - dom.appendChild(video) - player.value = videojs(`videos`, { - autoplay:true, - bigPlayButton: true, - textTrackDisplay: true, - posterImage: true, - errorDisplay: false, - controlBar: true, - height: 600, - preload:'metadata' , - userActions: { - hotkeys: false // 禁用快捷键 - }, - sources:[{ - src:record.deviceUrl, - type:'application/x-mpegURL' - }] - }); - playerType.value = 'm3u8'; - player.value.play(); - }) - }else if(record.deviceReverseIotUrl && record.deviceReverseIotUrl != ''){ - let videohtml = - `
` - nextTick(() => { - let dom = document.querySelector('#parent2') - dom.innerHTML = videohtml - player.value = new EZUIKit.EZUIKitPlayer({ - id: 'videos', // 视频容器ID - accessToken: record.ysToken, - url: record.deviceReverseIotUrl, - audio: 0, - autoplay: true, - // simple: 极简版; pcLive: pc直播; pcRec: pc回放; mobileLive: 移动端直播; mobileRec: 移动端回放;security: 安防版; voice: 语音版; - template: 'security', - // themeData: this.themeData, - plugin: ['expend'], // 加载插件,talk-对讲 - height: 600, - showStreamInfo:false, + const videosWrap = document.getElementById('videos-wrap'); + videosWrap.style.height = '100%'; }) - playerType.value = 'ys'; + }else if(record.deviceUrl && record.deviceUrl !=''){ + let video = document.createElement('video'); + video.id = `videos`; + video.className = `video-js example-video vjs-default-skin vjs-big-play-centered`; + video.autoplay = 'autoplay'; + video.controls = 'controls'; + video.style = `object-fit: fill;width:100%;height:100%`; + video.preload = `auto`; + video.muted = `muted`; - const videosWrap = document.getElementById('videos-wrap'); - videosWrap.style.height = '100%'; - }) + nextTick(() => { + let dom = document.querySelector('#parent2') + dom.innerHTML = '';//先清空 + dom.appendChild(video) + player.value = videojs(`videos`, { + autoplay:true, + bigPlayButton: true, + textTrackDisplay: true, + posterImage: true, + errorDisplay: false, + controlBar: true, + height: 600, + preload:'metadata' , + userActions: { + hotkeys: false // 禁用快捷键 + }, + sources:[{ + src:record.deviceUrl, + type:'application/x-mpegURL' + }] + }); + playerType.value = 'm3u8'; + player.value.play(); + }) + } } + + } /** diff --git a/src/views/appmana/liveCamra/index.vue b/src/views/appmana/liveCamra/index.vue index 9032352..4fd2b5c 100644 --- a/src/views/appmana/liveCamra/index.vue +++ b/src/views/appmana/liveCamra/index.vue @@ -45,6 +45,7 @@ * 查看监控 */ function handleMonitor(record) { + record.isRewind = false; monitorRegisterModal.value.statistic(record); } @@ -52,6 +53,7 @@ * 查看历史监控 */ function handleHisMonitor(record) { + record.isRewind = true; monitorRegisterModal.value.statistic(record); }