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

tuicall-engine-wx

v2.2.0

Published

TUICallEngine miniProgram

Downloads

983

Readme

TUICallEngine API 简介

TUICallEngine API 是 无 UI 音视频通话接口。如果带 UI TUICallKit 组件 的交互不满足您的需求,您可以使用 TUICallEngine 接口自己封装交互。 由于小程序开发的限制,需要先给 live-pusher 绑定事件,具体可以参照 TUICallKit

安装依赖

npm:

npm install tuicall-engine-wx;

yarn:

yarn add tuicall-engine-wx;

使用

import TUICallEngine, { EVENT } from "tuicall-engine-wx";

const options = {
  sdkAppID: 0, // 接入时需要将 0 替换为您的云通信应用的 SDKAppID
  tim: tim, // tim 参数适用于业务中已存在 TIM 实例,为保证 TIM 实例唯一性。非必填
}
wx.$TUICallEngine = TUICallEngine.createInstance(options);
wx.$TUICallEngine.on(EVENT.INVITED, () => {});

API 概览

创建实例和事件回调

| API | 描述 | |-----|-----| | createInstance | 创建 TUICallEngine 实例(静态方法)| | destroyInstance | 销毁 TUICallEngine 实例(静态方法)| | on | 增加事件监听 | | off | 取消事件监听 |

通话操作相关接口函数

| API | 描述 | |-----|-----| | call | 发起 1v1 通话 | | accept | 接听通话 | | reject | 拒绝通话 | | hangup | 结束通话 | | switchCallMediaType | 切换通话媒体类型,比如视频通话切音频通话 |

设备控制相关接口函数

| API | 描述 | |-----|-----| | openCamera | 开启摄像头 | | closeCamera | 关闭摄像头 | | switchCamera | 切换前后摄像头 | | openMicrophone | 打开麦克风 | | closeMicrophone | 关闭麦克风 | | selectAudioPlaybackDevice | 选择音频播放设备(听筒/扬声器)|

其他接口函数

| API | 描述 | |-----|-----| | setSelfInfo | 设置用户的头像、昵称 | | setLogLevel | 设置日志级别,低于 level 的日志将不会输出 |

事件

| 事件名 | 说明 | |-----|-----| | INVITED | 被邀请通话 | | USER_ACCEPT | 用户接听 | | USER_ENTER | 用户进入通话 | | USER_LEAVE | 用户离开通话 | | USER_UPDATE | 用户更新 | | REJECT | 用户拒绝通话 | | NO_RESP | 用户无响应 | | LINE_BUSY | 用户忙线 | | CALLING_CANCEL | 通话被取消 | | CALL_END | 通话结束 | | SDK_READY | SDK Ready 回调 | | KICKED_OUT | 被踢下线 | | CALL_MODE | 切换通话模式 |

参考文档