Loading…

How to use the WeChat Mini Program video customer service function?

# Activate Tencent Cloud real-time audio and video service [https://curl.qcloud.com/exHrRPbA](https://curl.qcloud.com/exHrRPbA) ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607480823155-cb4157a4-f425-49db-a14f-44a881aaff3b.png) Record two pieces of information: + SDKAppID + key These two pieces of information will be used for real-time video chat later. # Configure system parameters ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607481960332-824831e9-444d-4018-86f1-1ff1997e95c7.png) Add system parameters of text type: + Parameter name:trtc_secret```json { "sdkappid": "xxxxxxxxx", "key": "xxxxxx" } ``` # Add server domain name to mini program ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607482983685-1b908379-e702-431f-a845-e9a136866658.png) Request legal domain name, add: [https://pingtas.qq.com](https://pingtas.qq.com) [https://tcb-api.tencentcloudapi.com](https://tcb-api.tencentcloudapi.com) [https://webim.tim.qq.com](https://webim.tim.qq.com) # Enable real-time audio and video permissions for the mini program ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607483059050-d3079ac3-0e7d-4c4d-8f6b-26957d630d24.png) If these two switches cannot be turned on, please add a category: + Tools --> Video customer service # Mini program code modification For details, please refer to [https://github.com/EastWorld/wechat-app-mall](https://github.com/EastWorld/wechat-app-mall) ## app.js ```javascript globalData: { sdkAppID: xxxxxxx } ``` ## Add components ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607483190939-b7516709-bba6-4758-9841-6c447c94099d.png) ## Function page ![](https://dcdn.it120.cc/yuque/0/2020/png/572726/1607483223757-2baa2b47-6447-4cf1-8926-1b1586fc36b0.png)