vue项目接入海康威视H5player

全局变量

data变量

注意看demo,我这里的变量很多改过,进入高级模式(普通模式播不了)

  1. 方法引入

// 选择时间段 查看历史监控视频

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大厂高频面试题及答案附赠)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值