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

umvideo2-client

v2.13.0

Published

umvideo2 client

Downloads

12

Readme

联信视频 2.0

简便、易用、轻量的视频会议系统

概述

联信视频基于webrtc技术,将视频通话连接过程进行封装简化,提供客户端SDK用于快速搭建视频会议系统。服务器支持自主搭建私有云,支持国产Linux操作系统, 以及Docker快速部署。

系统结构

[系统框架图]

[SFU网络图]

[Mesh网络图]

特点

联信视频基于SFU/P2P混合模式进行视频通讯,可选“仅SFU/仅P2P/SFU优先/P2P优先”四种模式。 这些模式区别如下:

  1. 仅SFU:这种模式下,视频会议房间内的端对端全部使用SFU模式,即通过服务器中转分发的方式进行视频通讯。特点是建立连接稳定,但是对服务器带宽要求高,对客户端带宽和性能要求低。
  2. 仅P2P:这种模式下,视频会议房间内的端对端全部使用P2P模式,即点对点直连方式进行视频通话。特点是连接建立不稳定,同时支持的端不多。但是对服务器几乎无要求,对客户端性能和带宽要求高,且客户端所处网络必须支持NAT穿透。
  3. SFU优先:混合模式,SFU优先。如果P2P可以打通通道,则把SFU通道替换为P2P。特点是开始时对服务器要求高,如果P2P能稳定连接,则会逐渐降低服务器负载。这也是联信视频的默认模式。
  4. P2P优先:混合模式,P2P优先。如果P2P通道建立失败,则改为建立SFU通道代替P2P。特点是开始时对服务器性能要求低,后面可能会高。另外视频建立所需时间也比SFU优先要慢一些。

快速开始

安装客户端库

npm install umvideo2-client --save

准备页面

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>联信视频-快速开始</title>
  </head>
  <body>
    <div id="localMedia"></div>
    <div id="remoteMedias"></div>
  </body>
</html>

编写代码

import uv2 from 'umvideo2-client'

// [1] 设置SDK参数, 仅设置一次即可
uv2.setup({
  signalServer: "open.umnet.cn",    // 默认为当前网页所属地址。可以为ip或域名
  listenPort: 40000,                // 信令服务器端口
  localMedia: localMedia,           // 本地视频插入位置
  remoteMedias: remoteMedias,       // 远端媒体插入位置
})

// [2] 加入视频会议
let roomId = 'test_room_001'
let userName = '张三'
let connectType = 'sfufirst'        // 可选: sfu, p2p, sfufirst, p2pfirst
uv2.joinRoom(roomId, userName, connectType, (ret)=>{

  console.log('join room', ret.result)

  // 开启语音和视频
  uv2.setMediaEnable(uv2.mediaType.audio, true)
  uv2.setMediaEnable(uv2.mediaType.video, true)
})

// [3] 退出视频会议
// uv2.exitRoom()

文档

https://open.umnet.cn:40000/docs

更新记录

2.6.4

  • 支持npm导入
  • 添加快速开始示例

2.8.0

  • 支持sendCommand接口,用于发送房间指令,更改个人状态等操作

2.12.0

  • 支持token认证
  • 支持服务器预定房间人员列表模式
  • 支持服务器人员角色权限控制