Getting Started

Updated at:

This topic describes how to integrate the ApsaraVideo Real-time Communication plugin with an Alipay mini program. This integration enables one-to-one and many-to-many real-time audio and video calls between Alipay mini programs, or between an Alipay mini program and another application.

Prerequisites

  1. Subscribe to the ApsaraVideo Real-time Communication plugin and associate a mini program.

    Before you integrate the plugin, ensure that your Alibaba Cloud account or its root account has subscribed to this plugin and associated it with the target mini program. For detailed steps on how to obtain the plugin, click here.

  2. Configure the main mini program project.

    Open the project in the Mini Program Development Tool and configure the app.json file. In the file, change the "thePlugin" name to match your plugin code.

{
  "plugins": {
    "thePlugin": {
      "version": "*", // Currently, you can only set this to * to pull the latest listed version. 
      "provider": "2021002126663572"
    }
  }
}

Procedure

Activate the audio and video calling service

The audio and video calling service is provided by Alibaba Cloud mPaaS. Log on to the mPaaS console with your Alibaba Cloud account to activate the service. Then, obtain the parameters required for mini program integration, such as bizName, subBiz, workspaceId, and the key. The procedure is as follows:

  1. Log on to the Alibaba Cloud mPaaS console , click + Create Application, enter an application name, and create an mPaaS application.

  2. Navigate to your mPaaS application. In the navigation pane on the left, choose Audio and Video Calling > Call Application Management to open the product page.

  3. Create a call application. After the application is created, you can view its bizName and key. Users who share the same bizName can call each other.

  4. View the subBiz and workspaceId.

    1. On the mPaaS application homepage, choose Overview > Quick Download Code Configuration in the navigation pane on the left to open the code configuration page.

    2. On the code configuration page, find the App ID and Workspace ID. These values correspond to the subBiz and workspaceId parameters, respectively.

  5. Obtain the signature. Audio and video calling provides two methods to generate a signature:

  6. In your configuration, set the obtained bizName, subBiz, workspaceId, and signature parameters. You can then start audio and video calls.

  7. To allow mini program users to make audio and video calls with users on other platforms, see the following integration guides:

  8. For more information about integrating with Alipay mini programs, see API Overview.