Skip to main content

IRTCEngine

Create IRTCEngine

Parameters Note: the log switch and log path used to be on IRTCSetting (enable_stream_log / sdk_log_path) and have moved here— they’re consumed while the engine itself initializes, before any channel object exists.

Release IRTCEngine

Parameters

Get the version number

Parameters Note: the caller must allocate the memory before passing it in, at least 100 bytes.

Get the error code description

Parameters Note: the caller must allocate the memory for msg before passing it in, at least 100 bytes. The text is GBK-encoded Chinese.

Basic functions

Set the event handler

Parameters

Channel functions

You can join multiple channels at the same time. Each channel corresponds to an IRTCChannel object, and channel-level methods and callbacks are all on that object, instead of being distinguished by a leading channelId parameter on IRTCEngine as in older versions. About channelId
  • channelId is the value of the channel field in the token. The SDK parses it internally, and you get it through IRTCChannel::getChannelId()
  • channelId is used only by leaveChannel and getChannelIds; all other methods are called directly on the channel object

Create a channel object

Parameters Note: this only creates the object and doesn’t join the channel. After you get the object, set up its configuration and event handler, then call IRTCChannel::join(). Creating the same channel again returns Conflict; if no channel can be parsed from the token, it returns SdkTokenInvalid.

Leave a channel

Parameters

Leave all channels

Get the list of joined channels

Parameters

Media streaming functions

Network speed test

Parameters Note: the test results are returned in the callback.

Get camera info

Parameters

Get screen info

Parameters

Get microphone info

Parameters

Get speaker info

Parameters

Other

Add a log to upload

Parameters Logs you add are uploaded to the log server.