乐橙插件使用:
1.配置app.json文件,uniapp中在mainfest.json中配置
https://uniapp.dcloud.net.cn/collocation/manifest.html#mp-weixin
**
2、集成插件页面.json文件
**
uniapp在 pages.json 对应页面的 style -> usingComponents 引入组件:
https://uniapp.dcloud.net.cn/tutorial/miniprogram-subject.html#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E6%94%AF%E6%8C%81
3、获取管理员token
参考地址:https://open.imou.com/document/pages/fef620/
请求地址:https://openapi.lechange.cn/openapi/accessToken
{
“system”:{
“ver”:“1.0”,
“appId”:“lc3128c72c34d74192”,
“sign”:“b7e5bbcc6cc07941725d9ad318883d8e”,
“time”:1599013514,
“nonce”:“fbf19fc6-17a1-4f73-a967-75eadbc805a2”
},
“id”:“98a7a257-c4e4-4db3-a2d3-d97a3836b87c”,
“params”:{
}
}
获取临时权限校验秘钥—miniToken
参考地址:https://open.imou.com/document/pages/0b44e4/#_3%E3%80%81%E5%AF%B9%E6%8E%A5%E5%B0%8F%E7%A8%8B%E5%BA%8F%E6%8F%92%E4%BB%B6
请求地址:https://openapi.lechange.cn/openapi/createWeChatMiniProgramToken
{
“system”: {
“ver”: “1.0”,
“appId”: “lcdxxxxxxxxx”,
“sign”: “xxxxxxxxxxxxxx”,
“time”: 1603370757,
“nonce”: “1a411d5a-e88b-45ee-b590-53da98375edd”
},
“id”: “sdf23423lkj32l4324”,
“params”: {
“token”: “At_xxxxxxxxxxxxxxxxxx”, //就是上面的管理员token
“deviceId”: “9J07242PAZDED99”,
“channelId”: “0”
}
}
获取到miniToken后调用imou-player即可
4、使用
<imou-player miniToken="miniToken" deviceId="deviceId"
channelId="0" liveType='real' functionConfig='talk,snapShot,PTZ'
playConfig='{"resolution": "HD", "voice": "on", "fullScreen": "off"}' height='300'
bind:handleEvent="handleEvent">