@tool-set/hik-video
v1.0.0
Published
#### 安装
Downloads
2
Readme
封装了,海康威视监控事件 web 插件相关功能(监控,回放)
安装
新机需要安装插件
下载地址:
https://open.hikvision.com/download/5c67f1e2f05948198c909700?type=10
配置
新机需要额外配置
chrome://flags/#block-insecure-private-network-requests ---设置为 disabled
视频监控预览
- 需要先配置平台信息(appkey,originalSecret,ip)
import HIK from '@/index.ts'
HIK.install('appKey', 'appSecret', 'ip')
import { install, HIKPreview } from './index.esm.js'
await install({
appKey: '1212',
appSecret: '1212',
ip: '192.168.1.100',
})
// 初始化
const previewInstance = HIKPreview.Instance()
await previewInstance.init('hk-video')
// 预览
previewInstance.preview('cameraIndexCode')
视频监控回放
import { install, HIKPlayBack } from './index.esm.js'
await install({
appKey: '1212',
appSecret: '1212',
ip: '192.168.1.100',
})
// 初始化
const playbackInstance = HIKPlayBack.Instance()
await playbackInstance.init('hk-video')
// 回放
playbackInstance.playback('cameraIndexCode', { startTimeStamp: '', endTimeStamp: '' })
显示、隐藏、销毁插件
import { install, HIKPreview } from './index.esm.js'
await install({
appKey: '1212',
appSecret: '1212',
ip: '192.168.1.100',
})
// 初始化
const previewInstance = new HIKPreview()
await previewInstance.init('hk-video')
previewInstance.preview('1212')
// 隐藏
previewInstance.hideWnd()
// 显示
previewInstance.showWnd()
// 销毁
previewInstance.destroy()
插件事件
import { install, HIKPreview } from './index.esm.js'
await install({
appKey: '1212',
appSecret: '1212',
ip: '192.168.1.100',
})
// 初始化
const previewInstance = new HIKPreview()
await previewInstance.init('hk-video')
previewInstance.preview('1212')
previewInstance.on('message', () => {
// 插件事件回调
})
previewInstance.on('changeWnd', () => {
// 选中窗口事件回调
})