基于大华插件:H5播放器开发套件(wsplayer无插件开发包) V1.2.9
使用方法
npm i wspt
1. 找到node_modules目录中wspt文件夹,将static文件夹、jquery.min.js、palyer.css、PlayerControl.js、WSPlayer.js文件复制到项目public目录下。
public|-- jquery.min.js|-- player.css|-- PlayerControl.js|-- WSPlayer.js|-- static|-- utils.js|-- svg|-- WSPlayer|-- icon|-- multiThread|-- libdhplay.js|-- libdhplay.wasm|-- libdhplay.worker.js|-- singleThread|-- libdhplay.js|-- libdhplay.wasm|-- audioTalkWorker.js|-- PlayerControl.js|-- WSPlayer.js
<link href="/player.css" rel="stylesheet"><script src="/PlayerControl.js"></script><script src="/WSPlayer.js"></script><script src="/jquery.min.js"></script>
import wspt from 'wspt/wspt.umd'
app.use(wspt)
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
await proxy.$getWsptVideoStatus(loginInfo,item)
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
await proxy.getWsptItemStatus(item)
wsptLogin(params).then(res => {});
loginData:{username:"",//用户名password:"",//密码isEncryption:true,//密码是否已经加密proxyIp:""
}<wspt ref="wsptRef" :loginData="loginData" ></wspt>
wsptRef.value.encryptData("xxxxx")
const params={"method": "setTreeNodeList",//固定"data": [{"channelCode": "1000155$1$0$0",//监控通道号"id": "1000155$1$0$0",//监控通道号"isOnline": 1,//是否在线"cameraType": "2"//监控类型 1为枪机 2为球机 有云台}
}
wsptRef.value.wsptPlay(params)
<wspt ref="wsptRef" :hasPan="true"></wspt>
<div class="right-video-wrapper"><div class="operation-content-left"><div id="ws-pan-tilt"></div></div>
</div>
loginData:{username:"",//用户名password:"",//密码isEncryption:true,//密码是否已经加密proxyIp:""
}wsptRef.value.logins(loginData)
wsptRef.value.initPlayer()
wsptRef.value.initPlayer()
wsptRef.value.setPlayerNum(number)
wsptRef.value.close()