Getting Started
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
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.
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:
Log on to the Alibaba Cloud mPaaS console , click + Create Application, enter an application name, and create an mPaaS application.
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.
Create a call application. After the application is created, you can view its
bizNameand key. Users who share the samebizNamecan call each other.View the
subBizandworkspaceId.On the mPaaS application homepage, choose Overview > Quick Download Code Configuration in the navigation pane on the left to open the code configuration page.
On the code configuration page, find the App ID and Workspace ID. These values correspond to the
subBizandworkspaceIdparameters, respectively.
Obtain the signature. Audio and video calling provides two methods to generate a signature:
Secure signing: Generate a signature through a secure signing process.
Signature verification: Generate a temporary signature in the console to test the video calling product.
In your configuration, set the obtained
bizName,subBiz,workspaceId, andsignatureparameters. You can then start audio and video calls.To allow mini program users to make audio and video calls with users on other platforms, see the following integration guides:
For more information about integrating with Alipay mini programs, see API Overview.