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

@nereid/shine-vdc

v1.0.2

Published

shine voip dispatch center

Downloads

6

Readme

shine-vdc

banner

视频通话信令 SDK

目录

安装

使用 npm 包管理器

npm install @nereid/shine-vdc --save

使用 script 标签

<script src="path/to/index.js"></script>

使用

实例化

const vdc = new TQVdc({
  id: [用户ID],
  appKey: [无线云平台注册的clientNameSpace],
  dcUrl: [调度中心长链接地址],
  voipUrl: [视频通话地址],
  msgApi: [信令转发请求地址],
  host: [当前用户信息,需包含 `{id, name, sub}`三个字段]
});

监听事件

  • receive - 通话页面传递消息时触发的事件 (data) => {}

    • 默认情况下不太需要去关心该事件的处理,大部分的事件类型已经在内部做了处理,或者转成其他事件抛出

  • loaded - 通话页面成功加载的事件 () => {}

    • 一般意味着会议开始

  • unload - 通话页面关闭的事件 () => {}

  • end - 停止了会议 () => {}

  • call-vide - 当收到视频会议邀请时触发 ({ roomId, from, type } ) => {}

    • 当收到其他人的视频会议/通话邀请时,触发该事件,在该事件中可以主动弹出提示框,并告知用户是否接受或者拒绝

  • leave - 离开/强制离开会议时触发 ({msg}) => {}

  • accept - 当邀请人接受会议邀请时触发 (data) => {}

  • refuse - 当邀请人拒绝会议邀请时触发 (data) => {}

  • fetchUserInfoById - 需要获取用户信息时触发 (userId) => {}

    • 当视频会议中有新的参会人员加入时,会触发该事件,并传递参会人员的唯一标示信息,一般来说是用户id。在该事件的回掉中可以异步的请求人员信息,然后使用 sendUserInfo 传递该人员的信息

  • isMeetingChange - 会议状态改变事件 (flag) => {}

  • isDisconnectChange - 视频页面与当前业务(项目)通信状态改变事件 (flag) => {}

方法

vdc.createVoip(cb?: Function)

创建会议的方法,一般在会议创建完成后再发送会议邀请

| arguments | required | type | description | |:-|-|-|-| | cb | false | Function | 创建会议完成的回掉方法 |

vdc.invite(type: number, id: string, user: UserInfo)

发起视频邀请

| arguments | required | type | description | |:-|-|-|-| | type | true | number | 视频通话类型,2: 视频会议;3: 语音; 4: 视频通话 | | id | true | string | 被邀请的人员 id | | user | false | UserInfo | 被邀请人的相关信息 |

vdc.sendUserInfo(info: UserInfo)

传递用户信息的方法,配合fetchUserInfoById事件使用

| arguments | required | type | description | |:-|-|-|-| | info | true | UserInfo | 用户信息需包含以下字段{ id, name, sub } |

vdc.reopenVoip()

重新打开视频通话会议

vdc.answerVoip(room: string, from: string, isAccept: boolean, cb?: Function)

应答视频会议邀请的方法

| arguments | required | type | description | |:-|-|-|-| | room | true | string | 会议室id | | from | true | string | 邀请人 | | isAccept | true | boolean | 是否同意进入会议 | | cb | false | Function | 应答完成后的回调 |

vdc.destroy()

销毁实例,断开信令链接等操作