Skip to main content

IRTCChannel

IRTCChannel represents one channel and is created by IRTCEngine::createChannel. createChannel only parses the token and creates the object; it doesn’t join the channel. This gives you a chance to set up the configuration and event handler before join()—onJoinChannel is called back before join() returns, so if you set the handler too late, you miss it.
Always leave through IRTCEngine::leaveChannel; IRTCChannel itself has no leave(). After the call, the object has been destroyed, and you must set the pointer to null yourself.

Basic functions

Get the channel ID

Returns the value of the channel field in the token. The pointer is owned by the SDK and stays valid until you leave the channel; you don’t need to free it.

Get the settings object

Parameters

Set the event handler

Parameters Note: you must set it before join(); otherwise you don’t receive onJoinChannel.

Join the channel

Note: this is synchronous; onJoinChannel has already been called back before it returns. Calling it again returns Conflict. On failure, the channel object still exists, and you need to reclaim it with IRTCEngine::leaveChannel.

User info functions

Get your own user info

Parameters

Get channel info

Parameters

Get info for all users in the channel

Parameters

Get info for a specific user

Parameters

Error codes for channel-level methods

Media streaming functions

Get a video track object

Parameters

Get a screen sharing track object

Parameters

Get an audio track object

Parameters

Get a user’s audio track object

Parameters

Get a user’s video track object

Parameters

Get the composite stream video track object

Parameters

Subscribe to a track

Parameters

Unsubscribe from a track

Parameters

Publish a video track

Parameters

Publish an audio track

Parameters Note: the two publish overloads no longer have a default argument (the old publish(tk) was itself an ambiguous call and didn’t compile), so you must pass opt explicitly.