Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tuicall-engine-wx

Package Overview
Dependencies
Maintainers
2
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tuicall-engine-wx

TUICallEngine miniProgram

  • 2.1.1
  • npm
  • Socket score

Version published
Weekly downloads
61
increased by10.91%
Maintainers
2
Weekly downloads
 
Created
Source

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_READYSDK Ready 回调
KICKED_OUT被踢下线
CALL_MODE切换通话模式

参考文档

Keywords

FAQs

Package last updated on 15 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc