1.0.6 • Published 3 years ago
swprtspsdk v1.0.6
swprtspsdk
介绍
基于RTSP流播放的Web 播放器,需要安装exe应用程序插件包
软件架构
基于RTSP流播放的Web 播放器,需要安装exe应用程序插件包
安装教程
推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用。
npm install swprtspsdk --save
使用说明
main.js
import 'swprtspsdk/lib/style/index.css'
vue 页面
<template>
<div class="home">
<div class="player-container">
<ivs-web-player :conf="config">
<template #toolSlot>
我是一个底部自定义插槽
</template>
</ivs-web-player>
</div>
</div>
</template>
<script>
export default {
name: "Home",
components: {},
data() {
return {
config: {
ip: "xx.xx.xx.xx",
userName: "xx",
password: "xx@xx",
port: 9900,
theme:{
primaryColor: 'rgba(20,121,241,1)',
fontColor: 'rgba(255,255,255,0.7)'
}
},
};
},
};
</script>
属性
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
conf | config object | 无 | 播放器配置参数,参照config对象结构 |
事件
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
onPlayerEvent | void | 无 | 窗口事件响应 |
config 对象
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
ip | string | 无 | 视频云平台ip地址 |
userName | string | 无 | 视频云平台用户名 |
licenseServer | string | ip+port | 授权服务地址 |
password | string | 无 | 视频云平台密码 |
port | string | 9900 | 视频云平台端口号 |
wnd | number | 不传默认为9窗口 | 默认窗口数,支持1,4,6,9,12,16,24,32 |
download | string | 无 | 客户端插件安装包路径指定内网可指定安装包的位置 |
theme | theme object | 无 | 播放器默认主题 |
theme 对象
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
primaryColor | string | 无 | 主题色,支持(css rgb raba) |
fontColor | string | 无 | 字体,支持(css rgb raba) |
toolColor | string | 无 | 底部工具栏背景色,支持(css rgb raba) |
clientColor | int array | 无 | 插件背景色 R,G,B,A |
borderColor | string | 无 | 插件窗口分割线颜色 |
方法
名称 | 参数类型 | 默认值 | 返回值 | 说明 |
---|---|---|---|---|
playLive | param object | 无 | Promise | 实时画面 |
playRec | param object | 无 | Promise | 录像回放 |
changeWindow | number | 无 | void | 设置窗口数 |
localSnapshot | wnd | 不传,默认选中窗口 | Promise 图片为BASE64 | 本地抓拍 |
platformSnapshot | wnd | 不传,默认选中窗口 | Promise | 平台抓拍 |
closeWnd | wnd | 不传,默认选中窗口 | void | 关闭指定窗口 |
handleClear | 无 | 无 | void | 清空所有窗口播放 |
queryCameraData | {start:1,limit:20} | 无 | Promise | 查询设备信息 |
setTheme | theme object | 无 | void | 自定义主题 |
QueryRecordList | query object | 无 | Promise | 录像查询 |
param 对象
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
code | string | 无 | 摄像机编码 |
name | string | 无 | 摄像机名称 |
startTime | string | 无 | 录像开始时间 utc时间(yyyyMMdd HHmmss)实况无需传入 |
endTime | string | 无 | 录像结束时间 utc时间(yyyyMMdd HHmmss)实况无需传入 |
streamType | number | 默认为:2 | 实时画面的码流设置1主码流,2 辅码流 ,3 辅码流2 |
query 对象
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
cameraCodes | Array | 无 | 摄像机编码数组可多个设备进行录像片段查询 |
recordType | string | 无 | 录像类型 1 告警 2计划 4 手动 (组合查询如: 1+2+4=7 所有录像) |
startTime | string | 无 | 录像开始时间 utc时间(yyyyMMdd HHmmss)零时区 |
endTime | string | 无 | 录像结束时间 utc时间(yyyyMMdd HHmmss)零时区 |
注意:录像存储的时间节点为utc(零时区的时间)与当前用户所在时区有时差,根据当前时区去换算成零时区的时间节点传入。
示例
<template>
<div id="app" class="app">
<div class="app__header">IVSWEB播放器插件DEMO</div>
<div class="app__content">
<ivs-web-player ref="player" :conf="config"></ivs-web-player>
</div>
</div>
</template>
<script>
export default {
name: 'App',
data() {
return {
player: null,
downloadUrl: '',
config: {
ip: 'xx.xx.xx.xx',
userName: 'xxx',
password: 'xx@xx',
port: 9900
}
};
},
mounted() {
this.player = this.$refs.player;
},
methods: {
startLiveVideo() {
const camera={code='',name=''}
this.player.playLive(param).then(res => {
console.info('实况播放返回信息:', res);
});
},
startRecVideo() {
const camera={code='',name=''}
this.player.playRec(camera).then(res => {
console.info('录像回放返回信息', res);
});
}
}
};
</script>
客户端插件补充说明
ps:当前插件版本还处于测试阶段,软件已加入license ,需要作者进行许可授权,方可使用。联系电话:15724877571