npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hy-rtc-business

v0.1.21

Published

Hy-RTC-BUSINESS

Downloads

48

Readme

hy-rtc-business 核心模块

负责主要功能

  • [x] 订阅设备信息 (subscribeListFn) (已移除)

0.1.20版本改动

  • 新增 根据文件key 获取文件状态 getProgressByKey({clientId, key}, (res) => {})

0.1.17版本改动

  • 优化 优化订阅房间后,重复调用回调方法

0.1.15版本改动

  • [x] 查询⽇期列表 (queryFileDates)
  • [x] 查询⽂件列表 (queryFiles)
  • [x] 设备文件上传 (uploadFile)

0.1.13版本改动

  • [x] 添加订阅设备 (单个设备添加) (addSubscriptionDevice)

0.1.12版本改动

  • [x] 新增获取已经订阅的设备列表 (getSubscribedDevicesList)
  • [x] 新增拍照 (takePicture)
  • [x] 新增录像 (videoRecord)
  • [x] 新增开始录像 (startVideoRecord)
  • [x] 新增停止录像 (stopVideoRecord)
  • [x] 新增停止录像 (stopVideoRecord)
  • [x] 修改批量取消订阅设备 (resetDeviceIdList)
  • [x] 修改批量订阅设备状态 (bulkSubscriptionDevice)

0.1.0版本改动

  • [x] 新增场景 (addSceneDevice)
  • [x] 设备加入场景 (deviceJoinScene)
  • [x] 删除场景 (deleteSceneDevice)

接入流程

// npm 依赖包安装
npm i hy-rtc-business

// 在需要使用的页面引入
import HyRtcBusiness from 'hy-rtc-business'

// 初始化
/* 连接媒体服务 */
  const hyRtcBusiness = new HyRtcBusiness ({
    useSSL: true, // 是否启用SSL
    host: 'host', // IP地址
    port: 'port', // 端口号
    path: 'path', // 要连接到的主机上的路径
    clientId: 'clientId', // 标识符
    userName: 'userName', // 账号
    password: 'password' // 密码
  })
  hyRtcBusiness.eventEmit('open', () => {
    this.sdk = hyRtcSdk
    console.log('成功')
  })
  hyRtcBusiness.eventEmit('close', () => {
    console.log('连接失败回调事件')
  })
  hyRtcBusiness.eventEmit('disconnected', () => {
    console.log('绑定连接断开事件')
  })

 hyRtcBusiness.eventEmit('equipmentStatus', (res) => {
    console.log('设备状态, 需要先订阅设备信息才可以接受到设备状态')
  })


// 事件监听
this.rtc.eventEmit('事件名称', () => {})

相关操作方法

     /**
       obj: { sceneName: '场景名称', callback: 回调函数 }
      接受设备列表:deviceList 【{deviceId: 'deviceId'}】
      加入场景就会订阅设备消息
     */
    1、新增场景(addSceneDevice)
    this.hyRtcBusiness.addSceneDevice(obj, deviceList)

    /**
       sceneName: '场景名称' 
      接受设备列表:deviceList 【{deviceId: 'deviceId'}】
     */
    2、设备加入场景(deviceJoinScene)
    this.hyRtcBusiness.deviceJoinScene(sceneName, deviceList)

  /**
       sceneName: '场景名称' 
     */
    // 离开场景就会删除订阅设备消息
    3、删除场景(deleteSceneDevice)
    this.hyRtcBusiness.deleteSceneDevice(sceneName)