Compile and run a sample project
Agora provides open-source sample projects on GitHub to demonstrate the implementation of basic and advanced Video SDK features.
This page shows how to compile, configure, and run the Video SDK Unreal Engine sample project.
Prerequisites
-
Unreal Engine 4.27 or higher
-
Prepare your development environment according to your target platform and engine version:
Development platform Reference documentation Remarks Android Android development environment requirements - iOS iOS development environment requirements A valid Apple developer signature macOS macOS development environment requirements A valid Apple developer signature Windows Windows development environment requirements 32-bit Windows only supports Unreal Engine 4 and below. To use Unreal Engine with 32-bit Windows, uncomment the code relating to Win32
in theAgoraPluginLibrary.Build.cs
file -
Two physical devices for testing
- A computer with Internet access. If a firewall is deployed in your network environment, refer to Connect through restricted networks with Cloud Proxy to use Agora services normally.
- A camera and a microphone
- A valid Agora account and project
- Installed Git
Project setup
Get the sample project
-
Run the following command to clone the repository locally:
-
The C++ API usage examples are located in
/Agora-Unreal-SDK-CPP-Example
. These include:Description Path Basic functions /Agora-Unreal-SDK-CPP-Example/Content/API-Example/Basic
Advanced functions /Agora-Unreal-SDK-CPP-Example/Content/API-Example/Advance
Configure the sample project
Refer to the following steps to integrate the SDK:
- Go to SDKs to download the latest version of the Video SDK and unzip it.
- Under your project root folder, create a folder named Plugins.
- Copy AgoraPlugin from the SDK folder to Plugins.
Run the sample project
In the Unreal Editor, you can compile and run the sample project at the main level or any sublevel.
- Main Level
- Sub Level
-
In the path of the C++ API example, double-click AgoraExample.uproject to open the project.
-
Double-click MainLevel, then click Compile and run the sample project. You see the following interface:
-
Fill in the text box with the App ID and temporary token you obtained from the Agora Console, and the channel name you used to generate the token.
-
Click the button on the left to navigate from the main level to the sub-levels of the API example to experience the selected demo. Choose
BasicVideoCallScene
as an example, click JoinChannel to join the channel. You see yourself in the local view. -
To test various audio and video interaction scenarios, connect to the Agora web demo, or install and run the sample project on a second device. Make sure you use the same App ID on both devices. When you join the same channel from two devices, you can see and hear each other.
-
In the path of the C++ API example, double-click AgoraExample.uproject to open the project.
-
Choose BasicVideoCallScene as an example, double-click the sub-level in the Content Browser, and then click the BP_AgoraActor blueprint in the World Outliner panel. Fill in the App ID, temporary token, and channel name of your project in the Details panel.
-
Click Compile and run the sample project at the sublevel. You see the following interface:
-
Click JoinChannel to join the channel. You see yourself in the local view.
-
To test various audio and video interaction scenarios, connect to the Agora web demo, or install and run the sample project on a second device. Make sure you use the same App ID on both devices. When you join the same channel from two devices, you can see and hear each other.