注意看demo,我这里的变量很多改过,进入高级模式(普通模式播不了)
- 方法引入
// 选择时间段 查看历史监控视频
searchHistoryTime(){
if (!!!this.beginTime||!!!this.endTime){
this.KaTeX parse error: Expected ‘EOF’, got ‘}’ at position 106: … return; }̲ let t1 =…message({
message: ‘开始时间不得大于结束时间!’,
type: ‘warning’
})
return;
}
if (t2-t1>=259200000){
this.$message({
message: ‘时间区间不得超过3天!’,
type: ‘warning’
})
return;
}
$get(’/device/hkdevice/info/videoPlayBack’,{
beginTime:this.beginTime,
endTime:this.endTime,
cameraIndexCode:this.cameraIndexCode
}).then(res=>{
this.monitorHistoryUrl = res.data.data.url;
this.init();
this.createPlayer();
this.playbackStart();
})
},
init() {
// 设置播放容器的宽高并监听窗口大小变化
window.addEventListener(‘resize’, () => {
this.player.JS_Resize()
})
},
createPlayer() {
let szBasePath = ‘’;
//因为项目配置在二级域名,所以文件需改变路径
if (process.env.NODE_ENV == “production”) {
szBasePath = ‘/bzsv/js/’
}
else{
szBasePath = ‘/js/’
}
this.player = new window.JSPlugin({
szId: ‘player’,
szBasePath: szBasePath,
iMaxSplit: 4,
iCurrentSplit: 1,
openDebug: true,
oStyle: {
borderSelect: IS_MOVE_DEVICE ? ‘#000’ : ‘#FFCC00’,
}
})
// 事件回调绑定
this.player.JS_SetWindowControlCallback({
windowEventSelect: function (iWndIndex) { //插件选中窗口回调
console.log('windowSelect callback: ', iWndIndex);
},
pluginErrorHandler: function (iWndIndex, iErrorCode, oError) { //插件错误回调
console.log('pluginError callback: ', iWndIndex, iErrorCode, oError);
},
windowEventOver: function (iWndIndex) { //鼠标移过回调
//console.log(iWndIndex);
},
windowEventOut: function (iWndIndex) { //鼠标移出回调
//console.log(iWndIndex);
},
windowEventUp: function (iWndIndex) { //鼠标mouseup事件回调
//console.log(iWndIndex);
},
windowFullCcreenChange: function (bFull) { //全屏切换回调
console.log('fullScreen callback: ', bFull);
},
firstFrameDisplay: function (iWndIndex, iWidth, iHeight) { //首帧显示回调
console.log('firstFrame loaded callback: ', iWndIndex, iWidth, iHeight);
},
performanceLack: function () { //性能不足回调
console.log('performanceLack callback: ');
}
});
},
/* 回放 */
playbackStart() {
let { player, mode, playback } = this,
index = player.currentWindowIndex,
playURL = this.monitorHistoryUrl,
读者福利
========
由于篇幅过长,就不展示所有面试题了,想要完整面试题目的朋友(另有小编自己整理的2024大厂高频面试题及答案附赠)