Claw Machine: Client Setup

Claw Machine: Client Setup

Integrating the SDK

After integrating and configuring the Agora Wawaji SDK on the server (claw machine), you need to integrate and configure the SDK on the client. For more information, see Basic: Starting a Live Video Broadcast.

Running the Demo

The demo shows the following functionalities:

  • Join a claw machine room.
  • Live broadcast the prize grabbing process.
  • Leave a claw machine room.

Step 1: Prepare the Development Environment

Prepare the following development environment:

  • Microsoft Visual C++ 2013 or later.
  • Microsoft Visual Studio (recommended).
  • Microsoft Windows 7 or later.

Step 2: Download the Demo

Download Wawaji-RTC-Server-Windows Demo.

Step 3: Run the Demo

  1. Get an App ID (see Getting an App ID).
  2. Unpack the downloaded demo, and use Visual Studio to open the demo.
  3. Build the demo to generate an .exe file.
  4. Save all the .dll files under the /.dll folder of the demo to the folder with the .exe file.
  5. Double click the .exe file, input the acquired App ID, and click Join to start a live voice or video broadcast.

Code Snippets

Join a Channel

CAgoraObject* m_lpAgoraObject = CAgoraObject::GetAgoraObject(strAppId);
IRtcEngine *pRtcEngine = CAgoraObject::GetEngine();
RtcEngineParameters rep(pRtcEngine);
rep.enableWebSdkInteroperability(true);
m_lpAgoraObject->SetLogFilePath(NULL);
m_lpAgoraObject->SetMsgHandlerWnd(GetSafeHwnd());
CAgoraObject::GetEngine()->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING);
m_lpAgoraObject->EnableVideo(TRUE);
m_lpAgoraObject->SetClientRole(CLIENT_ROLE_BROADCASTER);
CAgoraObject::GetAgoraObject()->EnableLastmileTest(TRUE);

Leave a Channel

CAgoraObject *lpAgoraObject = CAgoraObject::GetAgoraObject();
lpAgoraObject->LeaveCahnnel();