<p align="center">
  <a href="https://trtc.io/">
    <img width="200" src="https://web.sdk.qcloud.com/trtc/webrtc/assets/trtc.io-logo.png">
  </a>
</p>

<h1 align="center" style="margin-top: -40px">TUICallEngine WX SDK</h1>

<div align="center">

![NPM verison](https://img.shields.io/npm/v/@tencentcloud/call-engine-wx) [![NPM downloads](https://img.shields.io/npm/dw/@tencentcloud/call-engine-wx)](https://www.npmjs.com/package/@tencentcloud/call-engine-wx) [![Typescript Supported](https://img.shields.io/badge/Typescript-Supported-blue)](https://www.npmjs.com/package/@tencentcloud/call-engine-wx) [![Documents](https://img.shields.io/badge/-Documents-blue)](https://cloud.tencent.com/document/product/647/78761) [![Stars](https://img.shields.io/github/stars/tencentyun/TUICallKit?style=social)](https://github.com/tencentyun/TUICallKit) 

</div>

<div align="center"> English | <a href="https://github.com/tencentyun/TUICallKit/tree/main/Web/call-engine-demo-vue3" target="_blank"> 简体中文</a> </div>


## 简介
TUICallEngine 是基于腾讯云 [即时通信 IM](https://cloud.tencent.com/document/product/269/42440) 和 [实时音视频 TRTC](https://cloud.tencent.com/document/product/647/16788) 两项付费 PaaS 服务构建出的音视频通信 SDK，支持双人和多人场景下的音视频通话。

- 我们提供适用于 Web、Android、iOS、小程序、Flutter 的 SDK，更多信息请参见 [trtc.io](https://cloud.tencent.com/document/product/647/78742)。


## 安装
使用 npm:
```
$ npm install @tencentcloud/call-engine-wx --save
```

使用 yarn:
```
$ yarn add @tencentcloud/call-engine-wx
```

手动下载 sdk 包：
1. 下载 [@tencentcloud/call-engine-wx](https://www.unpkg.com/@tencentcloud/call-engine-wx@latest)。
2. 将 `@tencentcloud/call-engine-wx` 复制到你的项目中。


## API 概要
- [tuiCallEngine](https://cloud.tencent.com/document/product/647/78761#createinstance) 对象，提供实时音视频通话的核心能力。
  - 开始 1v1（或多人） 通话 [calls](https://cloud.tencent.com/document/product/647/78761#calls)
  - 接通 [accept](https://cloud.tencent.com/document/product/647/78761#accept)
  - 拒绝 [reject](https://cloud.tencent.com/document/product/647/78761#reject)
  - 挂断 [hangup](https://cloud.tencent.com/document/product/647/78761#hangup)
  - 打开摄像头 [openCamera](https://cloud.tencent.com/document/product/647/78761#opencamera)
  - 打开麦克风 [openMicrophone](https://cloud.tencent.com/document/product/647/78761#openmicrophone)
  - 关闭摄像头 [closeCamera](https://cloud.tencent.com/document/product/647/78761#closecamera)
  - 关闭麦克风 [closeMicrophone](https://cloud.tencent.com/document/product/647/78761#closemicrophone)
  - 播放远端视频 [startRemoteView](https://cloud.tencent.com/document/product/647/78761#startremoteView)
  - 停止播放远端视频 [stopRemoteView](https://cloud.tencent.com/document/product/647/78761#stopremoteView)


## 目录结构
```
├── README-zh_CN.md
├── README.md
├── index.js     // 基于 umd 模块的 sdk 包
├── index.esm.js // 基于 esm 模块的 sdk 包
├── index.cjs.js // 基于 commonjs 模块的 sdk 包
├── index.d.ts   // 类型声明文件
└── package.json
```
