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

@hongtangyun/webrtc

v1.0.0

Published

TODO

Downloads

2

Readme

@hongtangyun/webrtc

demo

Getting started

$ npm install @hongtangyun/webrtc --save

Usage

import WebRTCSDk, { EVENT_TYPES } from '@hongtangyun/webrtc';

const appID = 'xxxxxx';
const token = 'xxxx';
cosnt uid = 1001;
const meetingNo = 1234;

async function init(webRtcType: string) {
  const client = new WebRTCSDk(webRtcType);
  await client.init(appID);

  client.on(EVENT_TYPES.userJoined, (uid) => {
    console.log('用户列表 ------ userJoined ------', uid)
  })
  client.on(EVENT_TYPES.userLeave, (uid) => {
    console.log('用户列表 ------ userLeave ------', uid)
  })
  await client.join(token, meetingNo, uid);
  await client.createRTCStream();
  await client.publish();
  return client;
}
<!-- web sdk -->
init('web');
<!-- electron sdk -->
init('electron');

方法

| 方法 | 描述 | | ------------- | ------------- | | init | 初始化客户端对象 | | join | 加入 AgoraRTC 频道 | | getDevices | 该方法枚举可用的媒体输入/输出设备,比如麦克风、摄像头、耳机等。 | | createRTCStream | 创建流 | | setupLocalVideo | 设置本地视频显示 | | setupRemoteVideo | 设置远程视频显示 | | publish | 发布本地音视频流 | | switchChannel | 快速切换直播频道 | | unpublish | 取消发布本地音视频流 | | subscribe | 接收远端音视频流 | | unsubscribe | 取消接收远端音视频流 | | setVideoDevice | 设置视频设备 | | setAudioPlaybackDevice | 通过设备 ID 指定音频播放设备 | | setAudioRecordingDevice | 设备音频录制设备 | | enableLocalVideo | 开/关本地音频采集 | | enableLocalAudio | 开/关本地音频采集 | | getScreenSources | 该方法用于获取屏幕共享源 | | createScreenStream | 创建屏幕分享流 | | screenPublish | 屏幕分享流推送 | | screenUnpublish | 屏幕分享流取消推送 | | leave | 离开频道,即机挂断或退出通话 | | on | 监听 | | destroy | 销毁 |

on监听

| 事件 | 描述 | | ------------- | ------------- | | joined | 加入成功 | | userJoined | 用户加入 | | userLeave | 用户离开 | | published | 本地音视频流已发布 | | unpublished | 本地音视频流已取消发布 | | error | 应用有错误信息 |