Agora provides two open-source sample projects: OpenLive-Windows (based on Qt) and OpenLive-Windows-MFC (based on MFC). This article describes how to run the sample projects.
To create an Agora project, do the following:
Agora automatically assigns each project an App ID as a unique identifier.
To copy this App ID, find your project on the Project Management page in Agora Console, and click the icon in the App ID column.
To ensure communication security, Agora recommends using tokens to authenticate users joining a channel.
For testing purposes, Agora Console supports generating RTC temporary tokens. To generate an RTC temporary token:
Clone the Basic-Video-Broadcasting repository. Navigate to the OpenLive-Windows folder.
Download the latest version of Video SDK. Unzip the file and perform the following operations:
sdk folder in OpenLive-Windows. In sdk, create two folders: include and lib..h files from libs\include to OpenLive-Windows\sdk\include.libs\x86 or libs\x86_64 to OpenLive-Windows\sdk\lib.OpenLive-Windows folder and open OpenLive.pro with Qt Creator.Headers/agoraobject.h, and replace APP_ID and APP_TOKEN with your App ID and Token.The following table shows the structure of the sample project. You can adjust the code per your requirements.
| Folder/File | Description |
|---|---|
OpenLive.pro |
QT project file |
Headers, Sources |
All .h files and .cpp files.
|
Forms |
All .ui files of the project to define the user interface |
Resources |
UI resource file |
Other files |
openlive.rc:Application icon file |
Clone the Basic-Video-Broadcasting repository. Navigate to the OpenLive-Windows-MFC folder.
Download the latest version of Video SDK. Unzip the file and perform the following operations:
sdk folder in OpenLive-Windows-MFC. In sdk, create three folders: include, dll, and lib..h files from libs\include to OpenLive-Windows-MFC\sdk\include.libs\x86\agora_rtc_sdk.dll or libs\x86_64\agora_rtc_sdk.dll to OpenLive-Windows-MFC\sdk\dll.libs\x86\agora_rtc_sdk.lib or libs\x86_64\agora_rtc_sdk.lib to OpenLive-Windows-MFC\sdk\lib.x86 folder, you must choose Win32 platform when running the project; If you select files from the x86_64 folder, you must choose x64 platform when running the project.OpenLive-Windows-MFC folder and open OpenLive.sln with Visual Studio.APP_ID and APP_TOKEN with your App ID and Token.The following table shows the structure of the sample project in the solution manager. You can adjust the code per your requirements.
| Folder | Description |
|---|---|
AgoraObject |
Main app logic, including:
|
App |
OpenLive main app class |
Headers |
Standard header files to include for MFC |
Resources |
Resource file |
UI |
User interface, including definitions for dialogs, windows, and controls |