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 🙏

© 2025 – Pkg Stats / Ryan Hefner

omnirtc-miniapp

v1.1.0

Published

直播中台微信小程序RTC SDK。如需接入,联系兰龙刚([email protected]

Readme

直播中台微信小程序RTC SDK。如需接入,联系兰龙刚([email protected]

OmniRTC-miniapp

引入SDK

  • ES Module引入
import getRTCInstance from 'omnirtc-miniapp';

加入RTC房间

  /**
   * 获取token,
   * 获取方式参考 https://wiki.zhiyinlou.com/pages/viewpage.action?pageId=30835986
   * 有问题联系周伟伟([email protected])老师 
   **/
  const token = 'token';
  // 获取引擎实例
  const client = getRTCInstance(token);

  // 加入房间前,先监听会议相关事件
  // 有其他用户开始推流了
  client.on('stream-added', async (uid, streamId) => {
    console.log('用户开始推流了。', uid, streamId)

    // 在这里就可以拉取该用户的流了,也可以先保存uid,延后再拉。
    const url = await client.subscribe(uid, streamId, { audio: true, video: true });

    console.log('媒体流已就绪,可以播放。', uid, streamId, url);
    // 小程序live-player上绑定推流地址。(下面绑定逻辑为伪代码,绑定方式需要开发者根据自身逻辑设置)
    LivePlayer.url = url;
  })
  client.on('stream-removed', (uid, streamId) => {
    console.log('用户停止推流了。', uid, streamId)
  })

  // 其他用户媒体状态变更
  client.on('mute-audio', (uid, streamId) => {
    console.log('用户暂停推音频流了。', uid, streamId)
  })
  client.on('unmute-audio', (uid, streamId) => {
    console.log('用户恢复推音频流了。', uid, streamId)
  })
  client.on('mute-video', (uid, streamId) => {
    console.log('用户暂停推视频流了。', uid, streamId)
  })
  client.on('unmute-video', (uid, streamId) => {
    console.log('用户恢复推视频流了。', uid, streamId)
  })

  // SDK内部报错
  client.on('error', (err) => {
    console.log('有报错。', err)
  })

  // 加入RTC房间
  client.join().then((uid) => {
    console.log('您已经加入房间了。您的用户ID:', uid)
  });
  ...

推送媒体流

  • 推送媒体流必须在调用client.join之后
  const streamId = uid;
  // 获取推流地址
  const url = await client.publish(streamId);
  // live-pusher上绑定url。(下面绑定逻辑为伪代码,绑定方式需要开发者根据自身逻辑设置)
  LivePusher.url = url;
  // 停止推流
  await client.unpublish(streamId);

暂停推音/视频流

  • 调用之后,本地预览正常,服务器会暂停转发媒体流
  await client.muteLocal('audio');
  await client.muteLocal('video');

恢复推音/视频流

  • 调用之后,服务器恢复转发媒体流
  await client.unmuteLocal('audio');
  await client.unmuteLocal('video');

拉取远端流

  • 必须在收到远端用户stream-added之后再调用client.subsribe
  // 拉取远端用户流
  const url = await client.subscribe(uid, streamId, { audio: true, video: true});
  // live-player上绑定url
  LivePusher.url = url;
  // 停止拉远端流
  await client.unsubscribe(uid, streamId)

暂停拉音/视频流

  await client.muteRemote(uid, streamId, 'audio');
  await client.muteRemote(uid, streamId, 'video');

恢复拉音/视频流

  await client.muteRemote(uid, streamId, 'audio');
  await client.muteRemote(uid, streamId, 'video');

域名白名单

Request:
https://sdk.eaydu.com
https://serverlog.eaydu.com:15100
https://rtc-logs.magic-school.com
https://uap-ap-web-1.agora.io
https://uap-ap-web-2.agoraio.cn
https://uap-ap-web-3.agora.io
https://uap-ap-web-4.agoraio.cn
https://report-ad.agoralab.co
https://rest-argus-ad.agoralab.co
https://uni-webcollector.agora.io

Socket:
wss://miniapp.eaydu.com
wss://miniapp.agoraio.cn

全部接口在 接口列表