1.0.6 • Published 3 years ago

swprtspsdk v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

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>

属性

名称类型默认值说明
confconfig object播放器配置参数,参照config对象结构

事件

名称类型默认值说明
onPlayerEventvoid窗口事件响应
config 对象
名称类型默认值说明
ipstring视频云平台ip地址
userNamestring视频云平台用户名
licenseServerstringip+port授权服务地址
passwordstring视频云平台密码
portstring9900视频云平台端口号
wndnumber不传默认为9窗口默认窗口数,支持1,4,6,9,12,16,24,32
downloadstring客户端插件安装包路径指定内网可指定安装包的位置
themetheme object播放器默认主题

theme 对象

名称类型默认值说明
primaryColorstring主题色,支持(css rgb raba)
fontColorstring字体,支持(css rgb raba)
toolColorstring底部工具栏背景色,支持(css rgb raba)
clientColorint array插件背景色 R,G,B,A
borderColorstring插件窗口分割线颜色

方法

名称参数类型默认值返回值说明
playLiveparam objectPromise实时画面
playRecparam objectPromise录像回放
changeWindownumbervoid设置窗口数
localSnapshotwnd不传,默认选中窗口Promise 图片为BASE64本地抓拍
platformSnapshotwnd不传,默认选中窗口Promise平台抓拍
closeWndwnd不传,默认选中窗口void关闭指定窗口
handleClearvoid清空所有窗口播放
queryCameraData{start:1,limit:20}Promise查询设备信息
setThemetheme objectvoid自定义主题
QueryRecordListquery objectPromise录像查询
param 对象
名称类型默认值说明
codestring摄像机编码
namestring摄像机名称
startTimestring录像开始时间 utc时间(yyyyMMdd HHmmss)实况无需传入
endTimestring录像结束时间 utc时间(yyyyMMdd HHmmss)实况无需传入
streamTypenumber默认为:2实时画面的码流设置1主码流,2 辅码流 ,3 辅码流2

query 对象

名称类型默认值说明
cameraCodesArray摄像机编码数组可多个设备进行录像片段查询
recordTypestring录像类型 1 告警 2计划 4 手动 (组合查询如: 1+2+4=7 所有录像)
startTimestring录像开始时间 utc时间(yyyyMMdd HHmmss)零时区
endTimestring录像结束时间 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

版本更新

版本发行

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago