nimeet Docs
中文

Unreal C++ SDK Guide

Unreal C++ install, join, render and event handling.

Interface sections generated from the public SDK definitions

Version v1.1.0 · Updated 2026-10-26 · revision 1

The Unreal Engine (C++) SDK has the IRtcEngine + IRtcEngineEventHandler shape with lower-case method names, the same as the C++ surface on Android/Windows.

Prerequisites

  • Unreal Engine 5.2+ (a C++ project; the plugin must be enabled in .uproject).
  • Target-platform permissions: the system camera/microphone permission on Windows/macOS; for Android/iOS see each platform's requirements.
  • An appId and a token service (see Enable Services and Get Credentials).

Installation

text
# planned shape: put the plugin in the project directory
YourGame/Plugins/NimeetRtc/…
# after regenerating the project files, enable the NimeetRtc module in .uproject

Get a token

The game backend issues the token; the UE client only receives a string. In production a short-lived token is handed out at login and renewed in the onTokenPrivilegeWillExpire callback; do not compile the App Certificate into the client.

Join a channel

cpp
#include "NimeetRtc/IRtcEngine.h"

class FMeetingHandler final : public IRtcEngineEventHandler {
 public:
  void onJoinChannelSuccess(const char* channel, uid_t uid, int elapsed) override {}
  void onUserJoined(uid_t uid, int elapsed) override {}
  void onUserOffline(uid_t uid, USER_OFFLINE_REASON_TYPE reason) override {}
  void onTokenPrivilegeWillExpire(const char* token) override {}
  void onError(int err, const char* msg) override {}
};

void UMeetingSubsystem::Start(const FString& AppId, const FString& Token)
{
    Handler = MakeShared<FMeetingHandler>();
    Engine = createAgoraRtcEngine();

    RtcEngineContext Context;
    Context.appId = TCHAR_TO_UTF8(*AppId);
    Context.eventHandler = Handler.Get();
    Engine->initialize(Context);

    Engine->setChannelProfile(CHANNEL_PROFILE_LIVE_BROADCASTING);
    Engine->enableVideo();
    Engine->startPreview();
    Engine->joinChannel(TCHAR_TO_UTF8(*Token), "weekly-sync", "", 10001);
}

Publishing and subscribing

cpp
Engine->muteLocalAudioStream(true);
Engine->muteLocalVideoStream(true);
Engine->enableLocalVideo(false);
Engine->updateChannelMediaOptions(Options);

Screen sharing: getScreenCaptureSources → startScreenCaptureByDisplayId / startScreenCaptureByWindowId; render the remote picture with the VideoSurface component the plugin provides (or a custom texture callback).

Events

IRtcEngineEventHandler's C++ virtual functions: onJoinChannelSuccess, onUserJoined, onUserOffline, onFirstRemoteVideoDecoded, onTokenPrivilegeWillExpire, onError, onConnectionStateChanged.

Error handling

  • Synchronous methods return int; 0 means success and a negative value is an Agora error number;
  • Asynchronous errors arrive through onError;
  • Unimplemented capabilities return -4 (ERR_NOT_SUPPORTED).

Troubleshooting

SymptomCauseHandling
The plugin module is missing after packagingIt is not enabled in .uproject, or the project was not regeneratedEnable the module and Rebuild
Runtime crash inside a callbackCross-thread access to a UObjectSwitch back to the GameThread with AsyncTask
No camera pictureThe platform permission was not grantedGrant it in the system settings and restart the process
The remote picture does not showVideoSurface is not boundBind the surface to the target material/widget
Audio is monoAudio device configurationCheck the system default device and sample rate

Next steps

Platform information

Itemvalue
PlatformUnreal Engine(C++)
LanguageC++
SDK packageNimeetRtc
Interface version4.5.1
Compatible Agora APIAgora unreal-cpp API

The public interfaces are aligned with the Agora unreal-cpp API; installation and runtime requirements are listed under Prerequisites above.

Availability

This platform's SDK: Generally available. The examples use the public API; runtime capability follows the published SDK package.

join-channel flow

The method names, parameter types and return values match the API reference for the same platform. Where a method has several overloads, the most common one is shown here; see the API reference for all overloads.

StepInterfaceMethodOverload count
subscribe to remote mediaIBaseSpatialAudioEnginemuteRemoteAudioStream1
Create instance / initializeILocalSpatialAudioEngineinitialize1
Renew the TokenIMusicContentCenterrenewToken1
enable video and local previewIRtcEngineenableVideo1
Join a channelIRtcEnginejoinChannel2
Leave a channelIRtcEngineleaveChannel2
Channel scenariosIRtcEnginesetChannelProfile1
switch rolesIRtcEnginesetClientRole2
bind the local videoIRtcEnginesetupLocalVideo1
typescript
muteRemoteAudioStream(uid: uid_t, mute: bool): int
initialize(config: const LocalSpatialAudioConfig&): int
renewToken(token: const char*): int
enableVideo(): int
joinChannel(token: const char*, channelId: const char*, info: const char*, uid: uid_t): int
leaveChannel(): int
setChannelProfile(profile: CHANNEL_PROFILE_TYPE): int
setClientRole(role: CLIENT_ROLE_TYPE): int
setupLocalVideo(canvas: const VideoCanvas&): int

Events and callbacks

Callbacks are registered on IRtcEngineEventHandler; naming differs by platform, and the full list is in the API reference for the same platform.

CallbacksSignaturePurpose
onConnectionStateChangedonConnectionStateChanged(state: CONNECTION_STATE_TYPE, reason: CONNECTION_CHANGED_REASON_TYPE): voidjoin result / connection-state changes:update the UI accordingly and decide whether to reconnect.
onUserJoinedonUserJoined(uid: uid_t, elapsed: int): voidRemote user joined:allocate the frame container.
onFirstRemoteVideoDecodedonFirstRemoteVideoDecoded(uid: uid_t, width: int, height: int, elapsed: int): voidRemote video status:it can render once the first frame is decoded.
onUserOfflineonUserOffline(uid: uid_t, reason: USER_OFFLINE_REASON_TYPE): voidRemote user left:release the container and subscription.
onRequestTokenonRequestToken(): voidToken expiring soon:call the server to renew, then `renewToken`.
onErroronError(err: int, msg: const char*): voidRuntime errors:`err` is an Agora error number, route by the error-code table.
onNetworkQualityonNetworkQuality(uid: uid_t, txQuality: int, rxQuality: int): voidNetwork quality:report to Analytics or prompt the user.

Error codes

Constantvalue
ERR_ABORTED20
ERR_ADM_GENERAL_ERROR1005
ERR_ADM_INIT_PLAYOUT1008
ERR_ADM_INIT_RECORDING1011
ERR_ADM_START_PLAYOUT1009
ERR_ADM_START_RECORDING1012
ERR_ADM_STOP_PLAYOUT1010
ERR_ADM_STOP_RECORDING1013
ERR_ALREADY_IN_USE19
ERR_BITRATE_LIMIT115
ERR_BUFFER_TOO_SMALL6
ERR_CLIENT_IS_BANNED_BY_SERVER123
ERR_CONNECTION_INTERRUPTED111
ERR_CONNECTION_LOST112
ERR_DATASTREAM_DECRYPTION_FAILED122
ERR_DECRYPTION_FAILED120
ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH130
ERR_FAILED1
ERR_INIT_NET_ENGINE21
ERR_INVALID_APP_ID101
ERR_INVALID_ARGUMENT2
ERR_INVALID_CHANNEL_NAME102
ERR_INVALID_STATE8
ERR_INVALID_TOKEN110
ERR_INVALID_USER_ACCOUNT134
ERR_INVALID_USER_ID121
ERR_JOIN_CHANNEL_REJECTED17
ERR_LEAVE_CHANNEL_REJECTED18
ERR_LOAD_MEDIA_ENGINE1001
ERR_NOT_INITIALIZED7
ERR_NOT_IN_CHANNEL113
ERR_NOT_READY3
ERR_NOT_SUPPORTED4
ERR_NO_PERMISSION9
ERR_NO_SERVER_RESOURCES103
ERR_OK0
ERR_REFUSED5
ERR_RESOURCE_LIMITED22
ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED119
ERR_SIZE_TOO_LARGE114
ERR_STREAM_MESSAGE_TIMEOUT117
ERR_TIMEDOUT10
ERR_TOKEN_EXPIRED109
ERR_TOO_MANY_DATA_STREAMS116
ERR_VDM_CAMERA_NOT_AUTHORIZED1501
IRtcEnginenull

the platform REST layer uses REST error codes;the SDK layer maps connection/authentication failures to Agora error numbers, for the mapping table see SDK error identifiers per platform。

Generated by the documentation build pipeline · 2026-10-31 01:24:02 UTC · Documentation center v1.1.0.

Content follows the public API definitions.

ni-meet is a self-hosted RTC PaaS with a LiveKit-based media plane (Apache-2.0) and an Agora-compatible API.