|
@@ -608,47 +608,9 @@ export default {
|
|
that.cameraVisible = true
|
|
that.cameraVisible = true
|
|
getHaiKangVideoServer({cameraCode:cameraCode}).then(newResponse => {
|
|
getHaiKangVideoServer({cameraCode:cameraCode}).then(newResponse => {
|
|
that.cameraTitle = '摄像头-'+newResponse.data.cameraName
|
|
that.cameraTitle = '摄像头-'+newResponse.data.cameraName
|
|
- that.oWebControl = new WebControl({
|
|
|
|
- szPluginContainer: 'playWnd', // 指定容器id
|
|
|
|
- iServicePortStart: 15900, // 指定起止端口号,建议使用该值
|
|
|
|
- iServicePortEnd: 15909,
|
|
|
|
- szClassId: '23BF3B0A-2C56-4D97-9C03-0CB103AA8F11', // 用于IE10使用ActiveX的clsid
|
|
|
|
- cbConnectSuccess: function() { // 创建WebControl实例成功
|
|
|
|
- that.oWebControl.JS_StartService('window', { // WebControl实例创建成功后需要启动服务
|
|
|
|
- dllPath: './VideoPluginConnect.dll' // 值"./VideoPluginConnect.dll"写死
|
|
|
|
- }).then(function() { // 启动插件服务成功
|
|
|
|
- that.oWebControl.JS_SetWindowControlCallback({ // 设置消息回调
|
|
|
|
- cbIntegrationCallBack: cbIntegrationCallBack
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- that.oWebControl.JS_CreateWnd('playWnd', 768, 462).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
|
|
|
- that.init(newResponse.data.appkey,newResponse.data.loginIp,newResponse.data.secret,newResponse.data.loginPort) // 创建播放实例成功后初始化
|
|
|
|
- })
|
|
|
|
- }, function() { // 启动插件服务失败
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- cbConnectError: function() { // 创建WebControl实例失败
|
|
|
|
- that.oWebControl = null
|
|
|
|
- $('#playWnd').html('插件未启动,正在尝试启动,请稍候...')
|
|
|
|
- WebControl.JS_WakeUp('VideoWebPlugin://') // 程序未启动时执行error函数,采用wakeup来启动程序
|
|
|
|
- initCount++
|
|
|
|
- if (initCount < 3) {
|
|
|
|
- setTimeout(function() {
|
|
|
|
- that.initPlugin(newResponse.data.appkey,newResponse.data.loginIp,newResponse.data.secret,newResponse.data.loginPort)
|
|
|
|
- }, 3000)
|
|
|
|
- } else {
|
|
|
|
- $('#playWnd').html('插件启动失败,请检查插件是否安装!')
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- cbConnectClose: function(bNormalClose) {
|
|
|
|
- // 异常断开:bNormalClose = false
|
|
|
|
- // JS_Disconnect正常断开:bNormalClose = true
|
|
|
|
- console.log('cbConnectClose')
|
|
|
|
- that.oWebControl = null
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ that.initPlugin(newResponse.data.appkey,newResponse.data.loginIp,newResponse.data.secret,newResponse.data.loginPort)
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
- that.playhk(newResponse.data.channelCode)
|
|
|
|
|
|
+ that.playhk('33e7f21691a843f6bcb4866efebe088b')
|
|
}, 5000)
|
|
}, 5000)
|
|
})
|
|
})
|
|
|
|
|
|
@@ -665,7 +627,7 @@ export default {
|
|
|
|
|
|
/** ----------------------------------海康摄像头预览开始------------------------------------- */
|
|
/** ----------------------------------海康摄像头预览开始------------------------------------- */
|
|
// 创建播放实例
|
|
// 创建播放实例
|
|
- initPlugin(appkey,loginIp,secret,loginPort) {
|
|
|
|
|
|
+ initPlugin(newappkey,newloginIp,newsecret,newloginPort) {
|
|
let that=this
|
|
let that=this
|
|
that.oWebControl = new WebControl({
|
|
that.oWebControl = new WebControl({
|
|
szPluginContainer: 'playWnd', // 指定容器id
|
|
szPluginContainer: 'playWnd', // 指定容器id
|
|
@@ -681,7 +643,7 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
that.oWebControl.JS_CreateWnd('playWnd', 768, 462).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
|
that.oWebControl.JS_CreateWnd('playWnd', 768, 462).then(function() { //JS_CreateWnd创建视频播放窗口,宽高可设定
|
|
- that.init(appkey,loginIp,secret,loginPort) // 创建播放实例成功后初始化
|
|
|
|
|
|
+ that.init(newappkey,newloginIp,newsecret,newloginPort) // 创建播放实例成功后初始化
|
|
})
|
|
})
|
|
}, function() { // 启动插件服务失败
|
|
}, function() { // 启动插件服务失败
|
|
})
|
|
})
|
|
@@ -693,7 +655,7 @@ export default {
|
|
initCount++
|
|
initCount++
|
|
if (initCount < 3) {
|
|
if (initCount < 3) {
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
- that.initPlugin(appkey,loginIp,secret,loginPort)
|
|
|
|
|
|
+ that.initPlugin(newappkey,newloginIp,newsecret,newloginPort)
|
|
}, 3000)
|
|
}, 3000)
|
|
} else {
|
|
} else {
|
|
$('#playWnd').html('插件启动失败,请检查插件是否安装!')
|
|
$('#playWnd').html('插件启动失败,请检查插件是否安装!')
|
|
@@ -730,15 +692,15 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
//初始化
|
|
//初始化
|
|
- init() {
|
|
|
|
|
|
+ init(newappkey,newloginIp,newsecret,newloginPort) {
|
|
let that = this
|
|
let that = this
|
|
that.getPubKey(function() {
|
|
that.getPubKey(function() {
|
|
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
|
////////////////////////////////// 请自行修改以下变量值 ////////////////////////////////////
|
|
- var appkey = '22654202' //综合安防管理平台提供的appkey,必填
|
|
|
|
- var secret = that.setEncrypt('d7HlmRIaiXp3MQBmsuUg') //综合安防管理平台提供的secret,必填
|
|
|
|
- var ip = '218.27.1.154' //综合安防管理平台IP地址,必填
|
|
|
|
|
|
+ var appkey = newappkey //综合安防管理平台提供的appkey,必填
|
|
|
|
+ var secret = that.setEncrypt(newsecret) //综合安防管理平台提供的secret,必填
|
|
|
|
+ var ip = newloginIp //综合安防管理平台IP地址,必填
|
|
var playMode = 0 //初始播放模式:0-预览,1-回放
|
|
var playMode = 0 //初始播放模式:0-预览,1-回放
|
|
- var port = loginPort //综合安防管理平台端口,若启用HTTPS协议,默认443
|
|
|
|
|
|
+ var port = Number(newloginPort) //综合安防管理平台端口,若启用HTTPS协议,默认443
|
|
var snapDir = 'D:\\SnapDir' //抓图存储路径
|
|
var snapDir = 'D:\\SnapDir' //抓图存储路径
|
|
var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
|
|
var videoDir = 'D:\\VideoDir' //紧急录像或录像剪辑存储路径
|
|
var layout = '1x1' //playMode指定模式的布局
|
|
var layout = '1x1' //playMode指定模式的布局
|