历史播放

This commit is contained in:
zy 2025-12-20 17:17:02 +08:00
parent 43af71a084
commit dacd296f0a
2 changed files with 86 additions and 77 deletions

View File

@ -68,89 +68,96 @@ function statistic(record) {
if(camType.value == 'ball' || camType.value === 'halfball') { if(camType.value == 'ball' || camType.value === 'halfball') {
width.value = 1000; width.value = 1000;
} }
if(record.deviceIotUrl && record.deviceIotUrl != ''){ if(record.isRewind) {
let videohtml = if(record.deviceReverseIotUrl && record.deviceReverseIotUrl != ''){
`<div style="width: 100%;height: 600px;margin:auto;"><div id="videos" style="width: 100%; height: 100%"></div></div>` let videohtml =
nextTick(() => { `<div style="width: 100%;height: 600px;margin:auto;"><div id="videos" style="width: 100%; height: 100%"></div></div>`
let dom = document.querySelector('#parent2') nextTick(() => {
dom.innerHTML = videohtml let dom = document.querySelector('#parent2')
player.value = new EZUIKit.EZUIKitPlayer({ dom.innerHTML = videohtml
id: 'videos', // ID player.value = new EZUIKit.EZUIKitPlayer({
accessToken: record.ysToken, id: 'videos', // ID
url: record.deviceIotUrl, accessToken: record.ysToken,
audio: 0, url: record.deviceReverseIotUrl,
autoplay: true, audio: 0,
// simple: ; pcLive: pc; pcRec: pc; mobileLive: ; mobileRec: ;security: ; voice: ; autoplay: true,
template: 'security', // simple: ; pcLive: pc; pcRec: pc; mobileLive: ; mobileRec: ;security: ; voice: ;
// themeData: this.themeData, template: 'security',
plugin: ['expend'], // talk- // themeData: this.themeData,
height: 600, plugin: ['expend'], // talk-
showStreamInfo:false, 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'); if(record.deviceIotUrl && record.deviceIotUrl != ''){
videosWrap.style.height = '100%'; let videohtml =
}) `<div style="width: 100%;height: 600px;margin:auto;"><div id="videos" style="width: 100%; height: 100%"></div></div>`
}else if(record.deviceUrl && record.deviceUrl !=''){ nextTick(() => {
let video = document.createElement('video'); let dom = document.querySelector('#parent2')
video.id = `videos`; dom.innerHTML = videohtml
video.className = `video-js example-video vjs-default-skin vjs-big-play-centered`; player.value = new EZUIKit.EZUIKitPlayer({
video.autoplay = 'autoplay'; id: 'videos', // ID
video.controls = 'controls'; accessToken: record.ysToken,
video.style = `object-fit: fill;width:100%;height:100%`; url: record.deviceIotUrl,
video.preload = `auto`; audio: 0,
video.muted = `muted`; 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(() => { const videosWrap = document.getElementById('videos-wrap');
let dom = document.querySelector('#parent2') videosWrap.style.height = '100%';
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 =
`<div style="width: 100%;height: 600px;margin:auto;"><div id="videos" style="width: 100%; height: 100%"></div></div>`
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'; }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'); nextTick(() => {
videosWrap.style.height = '100%'; 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();
})
}
} }
} }
/** /**

View File

@ -45,6 +45,7 @@
* 查看监控 * 查看监控
*/ */
function handleMonitor(record) { function handleMonitor(record) {
record.isRewind = false;
monitorRegisterModal.value.statistic(record); monitorRegisterModal.value.statistic(record);
} }
@ -52,6 +53,7 @@
* 查看历史监控 * 查看历史监控
*/ */
function handleHisMonitor(record) { function handleHisMonitor(record) {
record.isRewind = true;
monitorRegisterModal.value.statistic(record); monitorRegisterModal.value.statistic(record);
} }