WinDemo - aopacloud/aopa-rtc GitHub Wiki

Run through API sample project

Opa provides an open source sample project on GitHub AopaRtcWinDemonstrate the API usage examples of the OPA RTC SDK to help developers better understand and use the functions of the OPA SDK.

This article describes how to quickly run through Windows sample projects and experience real-time audio and video functions.

Precondition

The sample project is based on MFC. Before running the project, please ensure that your Visual Studio has installed * * C++MFC (x86 and x64) * * components for the latest v142 generation tool.

  • Two devices running Windows 7 and above.

  • Refer to [Open Service] to create a valid Opa account and Opa project, and obtain the following information from the Opa console:

    • App ID: A string randomly generated by Opa to identify your project.
    • Temporary Token: Token is also called dynamic key, which authenticates the user when the client joins the channel. The temporary token is valid for 24 hours.
    • Channel Name: string used to identify the channel.

Operating Steps

Get sample project

  1. Run the following command to clone the warehouse locally:

    Shell

    git clone [email protected]:aopacloud/aopa-rtc.git
    
    
  2. The warehouse contains sample projects of all the native platforms of the Opa real-time audio and video SDK. The API usage examples of the Windows platform are located in the path of '/AppRtcWin'.

Configuration sample project

  1. Integrate SDK and install dependencies

    Run 'AopaRtcWindow. sln' to automatically integrate the SDK, download dependencies, and configure the environment.

  2. Set App ID and Token

    Open the file '/AopaRtcWin/stdafx. h', and fill in the 'enter your App id' and 'enter your temporary token' with the App ID and temporary token you obtained from the Opa console. C++

    #define APP_ID     "enter your App id"  
    #define APP_TOKEN  "enter your temporary token"  
    
    

Compile and run the sample project

  1. Open the file '/AopaRtcWin/AopaRtcWindow. sln' with Visual Studio.

  2. Click 图片 开始编译。

  3. After successful compilation, the following window will pop up on your Windows device:

  4. You can choose any scene you want to experience. Taking the * * LiveBroadcasting * * live broadcast scenario in * * Basic Scene * * as an example, enter the channel name specified when generating a temporary token in * * Channel Name * *, and click * * JoinChannel * * to join the channel.

  5. In order to better experience various audio and video interaction scenarios, you can invite a friend to use another device to run the sample project, use the same App ID, Token and channel name to join the channel, and you will see and hear each other

Next chapter:android api self define