This document describes how to quickly run the ApsaraVideo Real-time Communication (ARTC) sample project and experience its real-time audio and video features.
Download the sample source code
Alibaba Cloud provides an open source sample project that demonstrates how to use the ARTC SDK APIs. This project helps developers more intuitively understand and integrate the SDK features. For more information, see the Windows sample project repository.
Prerequisites
Before running the sample project, ensure your development environment meets the following requirements:
Development tool: Visual Studio 2015 or later. Use the latest stable version.
Test device: A Windows PC running Windows 7 or later.
Network environment: Stable network connectivity.
Application setup: Obtain the AppID and AppKey for your ApsaraVideo Real-time Communication application. For details, see Create Application.
Procedure
Step 1: Get the sample project
Clone the ARTC sample project to your local machine:
git clone https://github.com/MediaBox-Demos/amdemos-artcThis repository contains sample projects for multiple native platforms using the ARTC SDK. The Windows platform sample is located in the Windows/ folder.
The sample project includes client-side code for generating tokens to help you test.
The following shows the file structure of the Windows/ARTCExample project.
├── Windows // Root directory of the Windows project structure
│ ├── ARTCExample // Source code directory for the API example
│ ├── ARTCExampleDefine.h // Set AppId, AppKey, and other information
│ ├── include // ARTC SDK header files directory
│ ├── ... // Other files
│ ├── lib // ARTC SDK static library directory
│ ├── x64 // x64 version of ARTC libraries
│ ├── AliRTCSdk.lib // Symbol file
│ ├── ... // Other ARTC SDK files
│ ├── x86 // x86 version of ARTC libraries
│ ├── AliRTCSdk.lib // Symbol file
│ ├── ... // Other ARTC SDK files
│ ├── ARTCExample.sln // Demo project fileStep 2: Configure the sample project
After downloading the source code, open the
Windowsfolder.You can go to SDK download/integration to download the Windows ARTC SDK. You must place the static libraries in the lib folder and the header files in the include folder as shown above. After successfully compiling the main project, you must place the DLL files in the project's output directory.
In the
Windowsfolder, open the project fileARTCExample.sln.Configure your ApsaraVideo Real-time Communication AppID and AppKey. Open the file
Windows/ARTCExample/ARTCExampleDefine.hand enter the AppID and AppKey obtained from the console.
#define ARTC_APP_ID <ApsaraVideo Real-time Communication AppID>
#define ARTC_APP_KEY <ApsaraVideo Real-time Communication AppKey>Step 3: Compile and run the sample project
You can select the ARTCExample project and compile it.
At runtime, you must place the ARTC DLL files in the application binary output directory of the project. By default, this directory is the
debug/releasefolder under thex64folder, which is one level above theARTCExamplefolder.After successful compilation, you can run the app to try the API example.