Integrate the DingRTC mini program SDK

Updated at:

This topic explains how to integrate the DingRTC SDK for a WeChat Mini Program.

Prerequisites

  1. Make sure your WeChat Mini Program account has permissions for the live-pusher and live-player components.

  2. In your WeChat Mini Program, go to the 'Development' section and enable 'Real-time audio and video playback' and 'Real-time audio and video recording'.

  3. In the development settings for your WeChat Mini Program, add the following domains to the server domain list:

    • In the 'valid request domain' section, enter the following HTTPS domains:

      https://gslb-bk.dingrtc.com
      https://gslb.dingrtc.com
      https://onertc-client-zb.cn-zhangjiakou.log.aliyuncs.com
    • In the 'valid socket domain' section, enter the following WSS domains:

      wss://relaysvr-ff1.mcs.dingtalk.com
      wss://relaysvr-ff2.mcs.dingtalk.com
      wss://relaysvr-hk1.mcs.dingtalk.com
      wss://relaysvr-hk2.mcs.dingtalk.com
      wss://relaysvr-sg1.mcs.dingtalk.com
      wss://relaysvr-sg2.mcs.dingtalk.com
      wss://relaysvr-sh1.mcs.dingtalk.com
      wss://relaysvr-sh2.mcs.dingtalk.com
      wss://relaysvr-sv1.mcs.dingtalk.com
      wss://relaysvr-sv2.mcs.dingtalk.com
      wss://relaysvr-zb1.mcs.dingtalk.com
      wss://relaysvr-zb2.mcs.dingtalk.com

Integrate the SDK

  1. Download and decompress the mini program SDK, then copy the included JS file to your project folder.

  2. Import the mini program SDK into your project:

    const DingRTC = require('./path/to/dingrtc_mini_program.umd.0.7.0.js');

Next steps

After integrating the mini program SDK, you can implement basic audio and video communication functions. For more information, see Implement basic functions.