NERtc Unity SDK  V4.5.907
Public Member Functions | Public Attributes | List of all members
nertc.IRtcChannel Class Referenceabstract
Inheritance diagram for nertc.IRtcChannel:

Public Member Functions

abstract IRtcEngine GetEngine ()
 
abstract int Destroy ()
 
abstract string GetChannelName ()
 
abstract int JoinChannel (string token, ulong uid)
 
abstract int LeaveChannel ()
 
abstract int SetStatsObserver (IMediaStatsObserver observer)
 
abstract int EnableLocalAudio (bool enabled)
 
abstract int MuteLocalAudioStream (bool mute)
 
abstract int EnableLocalVideo (bool enabled)
 
abstract int MuteLocalVideoStream (bool mute)
 
abstract int StartScreenCaptureByScreenRect (RtcRectangle screenRect, RtcRectangle regionRect, RtcScreenCaptureParameters captureParams)
 
abstract int StartScreenCaptureByDisplayId (ulong displayId, RtcRectangle regionRect, RtcScreenCaptureParameters captureParams)
 
abstract int StartScreenCaptureByWindowId (IntPtr windowId, RtcRectangle regionRect, RtcScreenCaptureParameters captureParams)
 
abstract int StartScreenCapture (RtcScreenCaptureParameters captureParams, bool externalCapturer)
 
abstract int UpdateScreenCaptureRegion (RtcRectangle regionRect)
 
abstract int StopScreenCapture ()
 
abstract int PauseScreenCapture ()
 
abstract int ResumeScreenCapture ()
 
abstract int SetExcludeWindowList (IntPtr[] windowList)
 
abstract int SetupLocalVideoCanvas (RtcVideoCanvas canvas)
 
abstract int SetupLocalSubstreamVideoCanvas (RtcVideoCanvas canvas)
 
abstract int SetLocalRenderMode (RtcVideoScalingMode scalingMode)
 
abstract int SetLocalSubstreamRenderMode (RtcVideoScalingMode scalingMode)
 
abstract int SetLocalVideoMirrorMode (RtcVideoMirrorMode mirrorMode)
 
abstract int SetupRemoteVideoCanvas (ulong uid, RtcVideoCanvas canvas)
 
abstract int SetupRemoteSubstreamVideoCanvas (ulong uid, RtcVideoCanvas canvas)
 
abstract int SetRemoteRenderMode (ulong uid, RtcVideoScalingMode scalingMode)
 
abstract int SetRemoteSubsteamRenderMode (ulong uid, RtcVideoScalingMode scalingMode)
 
abstract int SetClientRole (RtcClientRole role)
 
abstract int SetLocalMediaPriority (int priority, bool isPreemptive)
 
abstract RtcConnectionStateType GetConnectionState ()
 
abstract int SetCameraCaptureConfig (RtcCameraCaptureConfig config)
 
abstract int SubscribeAllRemoteAudioStream (bool subscribe)
 
abstract int SetVideoConfig (RtcVideoConfig config)
 
abstract int EnableDualStreamMode (bool enable)
 
abstract int SubscribeRemoteAudioStream (ulong uid, bool subscribe)
 
abstract int SubscribeRemoteVideoStream (ulong uid, RtcRemoteVideoStreamType type, bool subscribe)
 
abstract int SubscribeRemoteVideoSubstream (ulong uid, bool subscribe)
 
abstract int AddLiveStreamTask (RtcLiveStreamTaskInfo info)
 
abstract int UpdateLiveStreamTask (RtcLiveStreamTaskInfo info)
 
abstract int RemoveLiveStreamTask (string taskId)
 
abstract int SendSEIMsg (byte[] data, int length, RtcVideoStreamType type)
 
abstract int SetLocalCanvasWatermarkConfigs (RtcVideoStreamType type, RtcCanvasWatermarkConfig config)
 
abstract int SetRemoteCanvasWatermarkConfigs (ulong uid, RtcVideoStreamType type, RtcCanvasWatermarkConfig config)
 
abstract int TakeLocalSnapshot (RtcVideoStreamType streamType, RtcTakeSnapshotCallback callback)
 
abstract int TakeRemoteSnapshot (ulong uid, RtcVideoStreamType streamType, RtcTakeSnapshotCallback callback)
 
abstract int AdjustRecordingSignalVolume (int volume)
 
abstract int AdjustPlaybackSignalVolume (int volume)
 
abstract int AdjustUserPlaybackSignalVolume (ulong uid, int volume)
 
abstract int StartChannelMediaRelay (RtcChannelMediaRelayConfig config)
 
abstract int UpdateChannelMediaRelay (RtcChannelMediaRelayConfig config)
 
abstract int StopChannelMediaRelay ()
 
abstract int SetLocalPublishFallbackOption (RtcStreamFallbackOption option)
 
abstract int SetRemoteSubscribeFallbackOption (RtcStreamFallbackOption option)
 
abstract int SetExternalVideoSource (bool enabled)
 
abstract int PushExternalVideoFrame (RtcExternalVideoFrame frame)
 
abstract int PushSubstreamExternalVideoFrame (RtcExternalVideoFrame videoFrame)
 
abstract int EnableSpatializer (bool enable)
 
abstract int EnableAvatar (bool enable)
 

Public Attributes

ChannelOnError ChannelOnError
 
ChannelOnWarning ChannelOnWarning
 
ChannelOnReleasedHwResources ChannelOnReleasedHwResources
 
ChannelOnJoinChannel ChannelOnJoinChannel
 
ChannelOnReconnectingStart ChannelOnReconnectingStart
 
ChannelOnConnectionStateChange ChannelOnConnectionStateChange
 
ChannelOnRejoinChannel ChannelOnRejoinChannel
 
ChannelOnLeaveChannel ChannelOnLeaveChannel
 
ChannelOnDisconnect ChannelOnDisconnect
 
ChannelOnClientRoleChanged ChannelOnClientRoleChanged
 
ChannelOnUserJoined ChannelOnUserJoined
 
ChannelOnUserLeft ChannelOnUserLeft
 
ChannelOnUserAudioStart ChannelOnUserAudioStart
 
ChannelOnUserAudioStop ChannelOnUserAudioStop
 
ChannelOnUserAudioMute ChannelOnUserAudioMute
 
ChannelOnUserVideoStart ChannelOnUserVideoStart
 
ChannelOnUserVideoStop ChannelOnUserVideoStop
 
ChannelOnUserVideoMute ChannelOnUserVideoMute
 
ChannelOnUserSubStreamVideoStart ChannelOnUserSubStreamVideoStart
 
ChannelOnUserSubStreamVideoStop ChannelOnUserSubStreamVideoStop
 
ChannelOnScreenCaptureStatusChanged ChannelOnScreenCaptureStatusChanged
 
ChannelOnFirstAudioDataReceived ChannelOnFirstAudioDataReceived
 
ChannelOnFirstVideoDataReceived ChannelOnFirstVideoDataReceived
 
ChannelOnFirstAudioFrameDecoded ChannelOnFirstAudioFrameDecoded
 
ChannelOnFirstVideoFrameDecoded ChannelOnFirstVideoFrameDecoded
 
ChannelOnLocalAudioVolumeIndication ChannelOnLocalAudioVolumeIndication
 
ChannelOnRemoteAudioVolumeIndication ChannelOnRemoteAudioVolumeIndication
 
ChannelOnAddLiveStreamTask ChannelOnAddLiveStreamTask
 
ChannelOnUpdateLiveStreamTask ChannelOnUpdateLiveStreamTask
 
ChannelOnRemoveLiveStreamTask ChannelOnRemoveLiveStreamTask
 
ChannelOnLiveStreamStateChanged ChannelOnLiveStreamStateChanged
 
ChannelOnRecvSEIMessage ChannelOnRecvSEIMessage
 
ChannelOnMediaRelayStateChanged ChannelOnMediaRelayStateChanged
 
ChannelOnMediaRelayEvent ChannelOnMediaRelayEvent
 
ChannelOnPublishFallbackToAudioOnly ChannelOnPublishFallbackToAudioOnly
 
ChannelOnSubscribeFallbackToAudioOnly ChannelOnSubscribeFallbackToAudioOnly
 
ChannelOnAvatarUserJoined ChannelOnAvatarUserJoined
 
ChannelOnAvatarUserLeft ChannelOnAvatarUserLeft
 
ChannelOnAvatarStatus ChannelOnAvatarStatus
 

Detailed Description

The IRtcChannel class provides methods that enable real-time communications in a specified channel. By creating multiple IRtcChannel instances, users can join multiple channels.

Member Function Documentation

◆ GetEngine()

abstract IRtcEngine nertc.IRtcChannel.GetEngine ( )
pure virtual

Gets the engine object.

Since
V4.5.0

◆ Destroy()

abstract int nertc.IRtcChannel.Destroy ( )
pure virtual

Destroys an IRtcChannel instance to release resources.

Since
V4.5.0

◆ GetChannelName()

abstract string nertc.IRtcChannel.GetChannelName ( )
pure virtual

Gets the current channel name.

Since
V4.5.0
Returns
  • Success: Return IRtcChannel channel name.
  • Fail: Return nothing.

◆ JoinChannel()

abstract int nertc.IRtcChannel.JoinChannel ( string  token,
ulong  uid 
)
pure virtual

Joins a channel of audio and video call.

Note
  • The user ID for each user in the channel must be unique, and the uid in the current IRtcChannel will reuse the UID in the IRtcEngine channel.
  • The channel name is the channeId of IRtcChannel specified when created.
Since
V4.5.0
Parameters
[in]tokenThe certification signature used in authentication (NERTC Token). Valid values:
  • Null. You can set the value to null in the debugging mode. This poses a security risk. We recommend that you contact your business manager to change to the default safe mode before your product is officially launched.
  • NERTC Token acquired. In safe mode, the acquired token must be specified. If the specified token is invalid, users are unable to join a room. We recommend that you use the safe mode.
[in]uidThe unique identifier of a user. The uid of each user in a room must be unique.
uid is optional. The default value is 0. If the uid is not specified (set to 0), the SDK automatically assigns a random uid and returns the uid in the callback of ChannelOnJoinChannel . The application layer must keep and maintain the return value. The SDK does not maintain the return value.
Returns
  • 0: Success.
  • Other values: Failure.

◆ LeaveChannel()

abstract int nertc.IRtcChannel.LeaveChannel ( )
pure virtual

Leaves the room.
Leaves a room for hang up or calls ended.
A user can call the LeaveChannel method to end the call before the user makes another call.
After the method is called successfully, the ChannelOnLeaveChannel callback is locally triggered, and the ChannelOnUserLeft callback is remotely triggered.

Note
Since
V4.5.0
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetStatsObserver()

abstract int nertc.IRtcChannel.SetStatsObserver ( IMediaStatsObserver  observer)
pure virtual

Registers a stats observer.

Since
V4.5.0
Parameters
[in]observerThe stats observer.
Returns
  • 0: Success.
  • Other values: Failure.

◆ EnableLocalAudio()

abstract int nertc.IRtcChannel.EnableLocalAudio ( bool  enabled)
pure virtual

Enables or disables local audio capture.
The method can enable the local audio again to start local audio capture and processing.
The method does not affect receiving or playing remote audio and audio streams.

Note
The method is different from MuteLocalAudioStream in:.
The method enables the internal engine, which is still valid after you call LeaveChannel.
Since
V4.5.0
Parameters
[in]enabled
  • true: Enables local audio feature again. You can enable local audio capture or processing by default.
  • false: Disables local audio feature again. You can stop local audio capture or processing.
Returns
  • 0: Success.
  • Other values: Failure.

◆ MuteLocalAudioStream()

abstract int nertc.IRtcChannel.MuteLocalAudioStream ( bool  mute)
pure virtual

Enables or disabling publishing the local audio stream. The method is used to enable or disable publishing the local audio stream.

Note
  • This method does not change the state of the audio-recording device because the audio-recording devices are not disabled.
  • The mute state is reset to unmuted after the call ends.
Since
V4.5.0
Parameters
[in]muteMute or Unmute.
  • true: Mutes the local audio stream.
  • false: Unmutes the local audio stream (Default).
Returns
  • 0: Success.
  • Other values: Failure.

◆ EnableLocalVideo()

abstract int nertc.IRtcChannel.EnableLocalVideo ( bool  enabled)
pure virtual

Enables or disables local audio capture and rendering.
The method enables local video capture.

Note
  • You can call this method before or after you join a room.
  • The method enables the internal engine, which is still valid after you call LeaveChannel.
  • After local video capture is successfully enabled or disabled, the ChannelOnUserVideoStop or ChannelOnUserVideoStart callback is remotely triggered.
Since
V4.5.0
Parameters
[in]enabledWhether to enable local video capture and rendering.
  • true: Enables the local video capture and rendering.
  • false: Disables the local camera device. After local video capture is disabled, remote users cannot receive video streams from local users. However, local users can still receive video streams from remote users. If the setting is false, the local camera is not required to call the method.
Returns
  • 0: Success.
  • Other values: Failure.

◆ MuteLocalVideoStream()

abstract int nertc.IRtcChannel.MuteLocalVideoStream ( bool  mute)
pure virtual

Stops or resumes sending the local video stream.
If the method is called Successfully, ChannelOnUserVideoMute is triggered remotely.

Note
  • When you call the method to disable video streams, the SDK doesn't send local video streams but the camera is still working.
  • The method can be called before or after a user joins a room.
  • If you stop publishing the local video stream by calling this method, the option is reset to the default state that allows the app to publish the local video stream.
  • EnableLocalVideo (false) is different from EnableLocalVideo (false). The EnableLocalVideo(false) method turns off local camera devices. The MuteLocalVideoStream method does not affect local video capture, or disable cameras, and responds faster.
Since
V4.5.0
Parameters
[in]mute
  • true: Not publishing local video streams.
  • false: Publishing local video streams (default).
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartScreenCaptureByScreenRect()

abstract int nertc.IRtcChannel.StartScreenCaptureByScreenRect ( RtcRectangle  screenRect,
RtcRectangle  regionRect,
RtcScreenCaptureParameters  captureParams 
)
pure virtual

Shares screens through specifying regions. Shares a certain screen or part of region of a screen. Users need to specify the screen region they wants to share in the method.
When calling the method, you need to specify the screen region to be shared, and share the overall frame of the screen or designated regions.
If you join a room and successfully call this method to enable the substream, the ChannelOnUserSubStreamVideoStart and SetExcludeWindowList callback is remotely triggered.

Note
  • The method applies to Windows only.
  • The method enables video substreams.
Since
V4.5.0
Parameters
screenRectThe relative position of the screen to virtual screens that is shared.
regionRectThe relative position of shared screen to the full screen. If you set the shared region beyond the frame of the screen, only content within the screen is shared. If you set the value of width or height as 0, the full screen is shared.
captureParamsThe configurations of screen sharing.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartScreenCaptureByDisplayId()

abstract int nertc.IRtcChannel.StartScreenCaptureByDisplayId ( ulong  displayId,
RtcRectangle  regionRect,
RtcScreenCaptureParameters  captureParams 
)
pure virtual

Enables screen sharing by specifying the ID of the screen. The content of screen sharing is sent by substreams.
If you join a room and call this method to enable the substream, the ChannelOnUserSubStreamVideoStart and ChannelOnScreenCaptureStatusChanged callback is remotely triggered.

Note
  • The method applies to only macOS.
  • The method enables video substreams.
Since
V4.5.0
Parameters
displayIdThe ID of the screen to be shared. Developers need to specify the screen they share through the parameters.
regionRectThe relative position of shared screen to the full screen.
captureParamsThe configurations of screen sharing.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartScreenCaptureByWindowId()

abstract int nertc.IRtcChannel.StartScreenCaptureByWindowId ( IntPtr  windowId,
RtcRectangle  regionRect,
RtcScreenCaptureParameters  captureParams 
)
pure virtual

Enables screen sharing by specifying the ID of the window. The content of screen sharing is sent by substreams.
If you join a room and call this method to enable the substream, the ChannelOnUserSubStreamVideoStart and SetExcludeWindowList callback is remotely triggered.

Note
  • The method applies to Windows only and macOS.
  • The method enables video substreams.
Since
V4.5.0
Parameters
windowIdThe ID of the window to be shared.
regionRectThe relative position of shared screen to the full screen.
captureParamsThe configurations of screen sharing.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartScreenCapture()

abstract int nertc.IRtcChannel.StartScreenCapture ( RtcScreenCaptureParameters  captureParams,
bool  externalCapturer 
)
pure virtual

Start screen capture from external video sources.

Note
Parameters
captureParamsencoding parameters. Screen capture parameters becomes invalid.
externalCapturerwhether capture from external.
Returns
  • 0: Success.
  • Other values: Failure.

◆ UpdateScreenCaptureRegion()

abstract int nertc.IRtcChannel.UpdateScreenCaptureRegion ( RtcRectangle  regionRect)
pure virtual

When sharing a screen or window, updates the shared region.

Since
V4.5.0
Parameters
regionRectThe relative position of shared screen to the full screen. If you set the shared region beyond the frame of the screen, only content within the screen is shared. If you set width or height as 0, the full screen is shared.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StopScreenCapture()

abstract int nertc.IRtcChannel.StopScreenCapture ( )
pure virtual

Stops screen sharing.
If you use the method to disable the substream after joining a room, the ChannelOnUserSubStreamVideoStop callback is remotely triggered.

Since
V4.5.0
Returns
  • 0: Success.
  • Other values: Failure.

◆ PauseScreenCapture()

abstract int nertc.IRtcChannel.PauseScreenCapture ( )
pure virtual

Pauses screen sharing.

Since
V4.5.0
Returns
  • 0: Success.
  • Other values: Failure.

◆ ResumeScreenCapture()

abstract int nertc.IRtcChannel.ResumeScreenCapture ( )
pure virtual

Resumes screen sharing.

Since
V4.5.0
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetExcludeWindowList()

abstract int nertc.IRtcChannel.SetExcludeWindowList ( IntPtr[]  windowList)
pure virtual

Sets the window list that need to be blocked in capturing screens. The method can be dynamically called in the capturing.

Since
V4.5.0
Parameters
windowListThe ID of the screen to be blocked.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetupLocalVideoCanvas()

abstract int nertc.IRtcChannel.SetupLocalVideoCanvas ( RtcVideoCanvas  canvas)
pure virtual

Sets local views.
This method is used to set the display information about the local video. The method is applicable for only local users. Remote users are not affected.
Apps can call this API operation to associate with the view that plays local video streams. During application development, in most cases, before joining a room, you must first call this method to set the local video view after the SDK is initialized.

Note
If you use external rendering on the Mac platform, you must set the rendering before the SDK is initialized.
Since
V4.5.0
Parameters
[in]canvasThe video canvas information.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetupLocalSubstreamVideoCanvas()

abstract int nertc.IRtcChannel.SetupLocalSubstreamVideoCanvas ( RtcVideoCanvas  canvas)
pure virtual

Sets a remote substream canvas.

  • This method is used to set the display information about the local secondary stream video. The app associates with the video view of local secondary stream by calling this method.
  • During application development, in most cases, before joining a room, you must first call this method to set the local video view after the SDK is initialized.
    Since
    V4.5.0
    Parameters
    [in]canvasThe video canvas information.
    Returns
  • 0: Success.
  • Other values: Failure.

◆ SetLocalRenderMode()

abstract int nertc.IRtcChannel.SetLocalRenderMode ( RtcVideoScalingMode  scalingMode)
pure virtual

Sets the display mode for local substreams video of screen sharing. This method is used to set the display mode about the local view. The application can repeatedly call the method to change the display mode.

Note
You must set the local canvas for local substreams through setupLocalSubStreamVideoCanvas.
Since
V4.5.0
Parameters
[in]scalingModeThe video display mode. RtcVideoScalingMode .
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetLocalSubstreamRenderMode()

abstract int nertc.IRtcChannel.SetLocalSubstreamRenderMode ( RtcVideoScalingMode  scalingMode)
pure virtual

Sets the local view display mode.
This method is used to set the display mode about the local view. The application can repeatedly call the method to change the display mode.

Note
You must set local secondary canvas before enabling screen sharing.
Since
V4.5.0
Parameters
[in]scalingModeThe video display mode. RtcVideoScalingMode .
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetLocalVideoMirrorMode()

abstract int nertc.IRtcChannel.SetLocalVideoMirrorMode ( RtcVideoMirrorMode  mirrorMode)
pure virtual

Sets the mirror mode of the local video. The method is used to set whether to enable the mirror mode for the local video. The mirror code determines whether to flip the screen view right or left. Mirror mode for local videos only affects what local users view. The views of remote users are not affected. App can repeatedly call this method to modify the mirror mode.

Since
V4.5.0
Parameters
[in]mirrorModeThe video mirror mode. For more information, see RtcVideoMirrorMode.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetupRemoteVideoCanvas()

abstract int nertc.IRtcChannel.SetupRemoteVideoCanvas ( ulong  uid,
RtcVideoCanvas  canvas 
)
pure virtual

Sets views for remote users.
This method is used to associate remote users with display views and configure the rendering mode and mirror mode for remote views that are displayed locally. The method affects only video display viewed by local users.

Note
  • You need to specify the uid of remote video when the interface is called. In general cases, the uid can be set before users join the room.
  • If the user ID is not retrieved, the App calls this method after the ChannelOnUserJoined event is triggered. To disassociate a specified user from a view, you can leave the canvas parameter empty.
  • After a user leaves the room, the association between a remote user and the view is cleared.
Since
V4.5.0
Parameters
[in]uidThe ID of a remote user.
[in]canvasThe video canvas information.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetupRemoteSubstreamVideoCanvas()

abstract int nertc.IRtcChannel.SetupRemoteSubstreamVideoCanvas ( ulong  uid,
RtcVideoCanvas  canvas 
)
pure virtual

Sets a remote substream video canvas.
The method associates a remote user with a substream view. You can assign a specified uid to use a corresponding canvas.

Note
  • If the uid is not retrieved, you can set the user ID after the app receives a message delivered when the ChannelOnUserJoined is triggered.
  • After a user leaves the room, the association between a remote user and the view is cleared.
  • After a user leaves the room, the association between a remote user and the canvas is cleared. The setting is automatically invalid.
Since
V4.5.0
Parameters
[in]uidThe ID of a remote user.
[in]canvasThe video canvas settings.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetRemoteRenderMode()

abstract int nertc.IRtcChannel.SetRemoteRenderMode ( ulong  uid,
RtcVideoScalingMode  scalingMode 
)
pure virtual

Sets display mode for remote views. This method is used to set the display mode for the remote view. App can repeatedly call this method to modify the display mode.

Since
V4.5.0
Parameters
[in]uidThe ID of a remote user.
[in]scalingModeThe video display mode. RtcVideoScalingMode .
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetRemoteSubsteamRenderMode()

abstract int nertc.IRtcChannel.SetRemoteSubsteamRenderMode ( ulong  uid,
RtcVideoScalingMode  scalingMode 
)
pure virtual

Sets substream video display modes for remote screen sharing.
You can use the method when screen sharing is enabled in substreams on the remote side. The application can repeatedly call the method to change the display mode.

Since
V4.5.0
Parameters
[in]uidThe ID of a remote user.
[in]scalingModeThe video display mode. RtcVideoScalingMode .
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetClientRole()

abstract int nertc.IRtcChannel.SetClientRole ( RtcClientRole  role)
pure virtual

Sets the role of a user in live streaming.
The method sets the role to host or audience. The permissions of a host and a viewer are different.

  • A host has the permissions to open or close a camera, publish streams, call methods related to publishing streams in interactive live streaming. The status of the host is visible to the users in the room when the host joins or leaves the room.
  • The audience has no permissions to open or close a camera, call methods related to publishing streams in interactive live streaming, and is invisible to other users in the room when the user that has the audience role joins or leaves the room.
Since
V4.5.0
Note
  • By default, a user joins a room as a host.
  • Before a user joins a room, the user can call this method to change the client role to audience. Users can switch the role of a user through the interface after joining the room.
  • If the user switches the role to audience, the SDK automatically closes the audio and video devices.
Parameters
[in]roleThe role of a user. RtcClientRole .
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetLocalMediaPriority()

abstract int nertc.IRtcChannel.SetLocalMediaPriority ( int  priority,
bool  isPreemptive 
)
pure virtual

Sets the priority of media streams from a local user.
If a user has a high priority, the media stream from the user also has a high priority. In unreliable network connections, the SDK guarantees the quality the media stream from users with a high priority.

Note
  • You must call the method before you call JoinChannel .
  • After switching channels, media priority changes to the default value of normal priority.
  • An RTC room has only one user that has a high priority. We recommend that only one user in a room call the SetLocalMediaPriority method to set the local media stream a high priority. Otherwise, you need to enable the preempt mode to ensure the high priority of the local media stream.
Since
V4.5.0
Parameters
priorityThe priority of the local media stream. The default value is kNERtcMediaPriorityNormal . For more information, see RtcMediaPriorityType .
isPreemptivespecifies whether to enable the preempt mode. The default value is false, which indicates that the preempt mode is disabled.
  • If the preempt mode is enabled, the local media stream preempts the high priority over other users. The priority of the media stream whose priority is taken becomes normal. After the user whose priority is taken leaves the room, other users still keep the normal priority.
  • If the preempt mode is disabled, and a user in the room has a high priority. After that, the high priority of the local client remains invalid and is still normal.
Returns
  • 0: Success.
  • Other values: Failure.

◆ GetConnectionState()

abstract RtcConnectionStateType nertc.IRtcChannel.GetConnectionState ( )
pure virtual

Gets the current connection status.

Since
V4.5.0
Returns
Returns the current network status. RtcConnectionStateType .

◆ SetCameraCaptureConfig()

abstract int nertc.IRtcChannel.SetCameraCaptureConfig ( RtcCameraCaptureConfig  config)
pure virtual

Sets the camera capturer configuration.
For a video call or live streaming, generally the SDK controls the camera output parameters. By default, the SDK matches the most appropriate resolution based on the user's SetVideoConfig configuration. When the default camera capture settings do not meet special requirements, we recommend using this method to set the camera capturer configuration:

  • If you want better quality for the local video preview, we recommend setting config as kNERtcCameraOutputQuality . The SDK sets the camera output parameters with higher picture quality.
  • To customize the width and height of the video image captured by the local camera, set the camera capture configuration as kNERtcCameraOutputManual .
Note
  • Call this method before or after joining the channel. The setting takes effect immediately without restarting the camera.
  • Higher collection parameters means higher performance consumption, such as CPU and memory usage, especially when video pre-processing is enabled.
Since
V4.5.0
Parameters
configThe camera capturer configuration.
Returns
0
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ SubscribeAllRemoteAudioStream()

abstract int nertc.IRtcChannel.SubscribeAllRemoteAudioStream ( bool  subscribe)
pure virtual

Unsubscribes or subscribes to audio streams from all remote users.

Note
  • When joins a room, local user subscribe audio streams from all remote users by default. Under the circumstances, do not call SubscribeAllRemoteAudioStream (true) to subscribe audio streams again.
  • You can call this method before joining a channel.
Since
V4.5.0
Parameters
subscribeWhether to unsubscribe audio streams from all remote users.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetVideoConfig()

abstract int nertc.IRtcChannel.SetVideoConfig ( RtcVideoConfig  config)
pure virtual

Sets local video parameters.
You can call this method before or after you join the room.

Note
  • Each profile has a set of video parameters, such as resolution, frame rate, and bitrate. All the specified values of the parameters are the maximum values in optimal conditions. If the video engine cannot use the maximum value of resolution, due to poor network performance, the value closest to the maximum value is taken.
  • This method is a full parameter configuration method. If this method is invoked repeatedly, the SDK refreshes all previous parameter configurations and uses the latest parameter. Therefore, you need to set all parameters each time you modify the configuration, otherwise, unconfigured parameters will be set to the default value.
  • Since V4.5.0, 'setVideoConfig' method takes effect in real time. In previous versions, the setting takes effect the next time local video is enabled.
Since
V4.5.0
Parameters
[in]configSets the video encoding parameters. For more information, see RtcVideoConfig.
Returns
  • 0: Success.
  • Other values: Failure.

◆ EnableDualStreamMode()

abstract int nertc.IRtcChannel.EnableDualStreamMode ( bool  enable)
pure virtual

Specifies whether to enable or disable the dual stream mode.
The method sets the single-stream mode or dual-stream mode. If the dual-stream mode is enabled, the receiver can choose to receive the high-quality stream or low-quality stream video. The high-quality stream has a high resolution and high bitrate. The low-quality stream has a low resolution and low bitrate.

Note
  • The method applies to camera data only. Video streams from external input and screen sharing are not affected.
  • You can call this method before or after you join a room. After the method is set, it can take effect after restarting the camera.
Since
V4.5.0
Parameters
[in]enableWhether to enable dual-stream mode.
  • true: Enables the dual-stream mode. This is the default value.
  • false: Disables the dual-stream mode.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SubscribeRemoteAudioStream()

abstract int nertc.IRtcChannel.SubscribeRemoteAudioStream ( ulong  uid,
bool  subscribe 
)
pure virtual

Unsubscribes from or subscribes to audio streams from specified remote users.
After a user joins a channel, audio streams from all remote users are subscribed by default. You can call this method to unsubscribe from or subscribe to audio streams from all remote users.

Note
When the kNERtcKeyAutoSubscribeAudio is enabled by default, users cannot manually modify the state of audio subscription.
Since
V4.5.0
Parameters
[in]uidThe user ID.
[in]subscribe
  • true: Subscribes to specified audio streams (default).
  • false: Unsubscribes from specified audio streams.
Returns
  • 0: Success.
  • 30005: State exception that is caused by the invalid interface if users enable the automatic subscription.
  • Other values: Failure.

◆ SubscribeRemoteVideoStream()

abstract int nertc.IRtcChannel.SubscribeRemoteVideoStream ( ulong  uid,
RtcRemoteVideoStreamType  type,
bool  subscribe 
)
pure virtual

Subscribes or unsubscribes video streams from specified remote users.

  • After a user joins a room, the video streams from remote users are not subscribed by default. If you want to view video streams from specified remote users, you can call this method to subscribe to the video streams from the user when the user joins the room or publishes the video streams.
  • This method can be called only if a user joins a room.
    Since
    V4.5.0
    Parameters
    [in]uidThe user ID.
    [in]typeThe type of the subscribed video streams. RtcRemoteVideoStreamType.
    [in]subscribe
  • true: Subscribes to specified video streams. This is the default value.
  • false: Not subscribing to specified video streams.
    Returns
  • 0: Success.
  • Other values: Failure.

◆ SubscribeRemoteVideoSubstream()

abstract int nertc.IRtcChannel.SubscribeRemoteVideoSubstream ( ulong  uid,
bool  subscribe 
)
pure virtual

Subscribes to or unsubscribes from remote substream video from screen sharing. You can receive the substream video data only after you subscribe to remote substream video stream.

Note
  • You must call the method after joining a room.
  • You must first set a remote substream canvas.
Since
V4.5.0
Parameters
[in]uidThe user ID.
[in]subscribe
  • true: Subscribes to or unsubscribes from video streams from specified remote users.
  • false: Unsubscribes from video streams of specified remote users.
Returns
  • 0: Success.
  • Other values: Failure.

◆ AddLiveStreamTask()

abstract int nertc.IRtcChannel.AddLiveStreamTask ( RtcLiveStreamTaskInfo  info)
pure virtual

After the method is successfully called, the current user can receive the notification about the status of the live stream.

Note
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
  • Only one address for the relayed stream is added in each call. You need to call the method for multiple times if you want to push many streams. An RTC room with the same channelId can create three different streaming tasks.
  • After the method is successfully called, the current user will receive related-status notifications of the live stream.
Since
V4.5.0
Parameters
[in]infoindicates information of live task. For more information, see RtcLiveStreamTaskInfo .
Returns
  • 0: Success.
  • Other values: Failure.

◆ UpdateLiveStreamTask()

abstract int nertc.IRtcChannel.UpdateLiveStreamTask ( RtcLiveStreamTaskInfo  info)
pure virtual

Updates and modifies a push task in a room.

Note
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
Since
V4.5.0
Parameters
[in]infoindicates information of live task. For more information, see RtcLiveStreamTaskInfo .
Returns
  • 0: Success.
  • Other values: Failure.

◆ RemoveLiveStreamTask()

abstract int nertc.IRtcChannel.RemoveLiveStreamTask ( string  taskId)
pure virtual

Deletes a push task.

Note
  • The method is applicable to only live streaming.
  • You can call the method in a room. The method is valid in calls.
  • When calls stop and all members in the room leave the room, the SDK automatically deletes the streaming task. If some users are still in the room, users who create the streaming task need to delete the streaming task.
Since
V4.5.0
Parameters
[in]taskIdThe ID of a live streaming task.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SendSEIMsg()

abstract int nertc.IRtcChannel.SendSEIMsg ( byte[]  data,
int  length,
RtcVideoStreamType  type 
)
pure virtual

Sends SEI messages.
While the local video stream is pushed, SEI data is also sent to sync some additional information. After SEI data is sent, the receiver can retrieve the content by listening on ChannelOnRecvSEIMessage callback.

  • Condition: After the video stream (mainstream) is enabled, the function can be invoked.
  • Data size limits: The SEI data can contain a maximum of 4,096 bytes in size. Sending an SEI message fails if the data exceeds the size limit. If a large amount of data is sent, the video bitrate rises. This degrades the video quality or causes broken video frames.
  • Frequency limit: we recommend that the maximum video frame rate does not exceed 10 fps.
  • Time to take effect: After the method is called, the SEI data is sent from the next frame in the fastest fashion or after the next 5 frames at the slowest pace.
Note
  • The SEI data is transmitted together with the video stream. Frame loss may occur in poor network connection. The SEI data will also get lost. We recommend that you send the data many times within the transmission frequency limits. In this way, the receiver can get the data.
  • By default, the SEI is transmitted by using the mainstream channel.
Since
V4.5.0
Parameters
dataThe custom SEI frame data.
lengthThe custom SEI data size whose maximum value does not exceed 4096 bytes.
typeThe type of the stream channel with which the SEI data is transmitted. For more information, see RtcVideoStreamType.
Returns
The value returned. A value of 0 That the operation is successful.
  • Success: Successfully joins the queue to be sent. The data are sent after the closest video frame.
  • failure: Date are limitedly sent for the high sent frequency and the overloaded queue. Or, the maximum data size exceeds 4k.

◆ SetLocalCanvasWatermarkConfigs()

abstract int nertc.IRtcChannel.SetLocalCanvasWatermarkConfigs ( RtcVideoStreamType  type,
RtcCanvasWatermarkConfig  config 
)
pure virtual

Adds a watermark image to the local video.

Note
  • The method applies to the local video canvas and does not affect the video stream. If the canvas is removed, the watermark will be automatically deleted.
  • Before you set a watermark, you must first set the canvas by calling related methods.
  • Watermark-related methods are currently unsupported on the macOS platform.
Since
V4.5.0
Parameters
typeThe type of video streams. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType.
configThe configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null is set to remove the watermark. For more information, see RtcCanvasWatermarkConfig.
Returns
  • 0: Success.
  • Other values: Failure.

◆ SetRemoteCanvasWatermarkConfigs()

abstract int nertc.IRtcChannel.SetRemoteCanvasWatermarkConfigs ( ulong  uid,
RtcVideoStreamType  type,
RtcCanvasWatermarkConfig  config 
)
pure virtual

Adds a watermark to the remote video canvas.

Note
-The method applies to the local video canvas and does not affect the video stream. If the canvas is removed, the watermark will be automatically deleted.
  • Before you set a watermark, you must first set the canvas by calling related methods.
  • Watermark-related methods are currently unsupported on the macOS platform.
Since
V4.5.0
Parameters
uidThe ID of a remote user.
typeThe type of video streams. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType.
configThe configuration of the watermark for the canvas. You can set text watermark, image watermark, and timestamp watermark. A value of null is set to remove the watermark. For more information, see RtcCanvasWatermarkConfig.
Returns
  • 0: Success.
  • Other values: Failure.

◆ TakeLocalSnapshot()

abstract int nertc.IRtcChannel.TakeLocalSnapshot ( RtcVideoStreamType  streamType,
RtcTakeSnapshotCallback  callback 
)
pure virtual

Takes a local video snapshot.
The takeLocalSnapshot method takes a local video snapshot on the local substream or local mainstream, and call RtcTakeSnapshotCallback callback to return data of snapshot screen.

Note
  • Before you call the method to capture the snapshot from the mainstream, you must first call StartVideoPreview ,or EnableLocalVideo and JoinChannel .
  • Before you call the method to capture the snapshot from the substream, you must first JoinChannel,and start screen sharing.
  • You can set text, timestamp, and image watermarks at the same time. If different types of watermarks overlap, the layers override previous layers following image, text, and timestamp.
Since
V4.5.0
Parameters
streamTypeThe video stream type of the snapshot. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType.
callbackThe snapshot callback. For information, see RtcTakeSnapshotCallback.
Returns
  • 0: Success.
  • Other values: Failure.

◆ TakeRemoteSnapshot()

abstract int nertc.IRtcChannel.TakeRemoteSnapshot ( ulong  uid,
RtcVideoStreamType  streamType,
RtcTakeSnapshotCallback  callback 
)
pure virtual

Takes a snapshot of a remote video.
You can call takeRemoteSnapshot to specify the uid of video screen of remote mainstreams and substreams, and returns screenshot data of RtcTakeSnapshotCallback callback.

Note
  • You need to call takeRemoteSnapshot after receiving callbacks of ChannelOnUserVideoStart and ChannelOnUserSubStreamVideoStart.
  • You can set text, timestamp, and image watermarks at the same time. If different types of watermarks overlap, the layers override previous layers following image, text, and timestamp.
Since
V4.5.0
Parameters
uidThe ID of a remote user.
streamTypeThe video stream type of the snapshot. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType.
callbackThe snapshot callback. For information, see RtcTakeSnapshotCallback.
Returns
  • 0: Success.
  • Other values: Failure.

◆ AdjustRecordingSignalVolume()

abstract int nertc.IRtcChannel.AdjustRecordingSignalVolume ( int  volume)
pure virtual

Adjusts the volume of captured signals.

Note
The method only adjusts the volume of captured signals in the application programs without modifying the volumes of the device. If you need to modify the volume of the device, see related interfaces of device management.
Parameters
[in]volumeindicates the volume of the captured recording. Valid values: 0 to 400. Where:
  • 0: Mute.
  • 100: The original volume.
  • 400: The maximum value can be four times the original volume. The limit value is protected.
Returns
  • 0: Success.
  • Other values: Failure.

◆ AdjustPlaybackSignalVolume()

abstract int nertc.IRtcChannel.AdjustPlaybackSignalVolume ( int  volume)
pure virtual

Adjusts the volume of the audio local playback.

Note
The method only adjusts the volume of captured signals in the application programs without modifying the volumes of the device. If you need to modify the volume of the device, see related interfaces of device management.
Parameters
[in]volumeindicates the playback volume. Valid range: 0 to 400. Where:
  • 0: Mute.
  • 100: The original volume.
  • 400: The maximum value can be four times the original volume. The limit value is protected.
Returns
  • 0: Success.
  • Other values: Failure.

◆ AdjustUserPlaybackSignalVolume()

abstract int nertc.IRtcChannel.AdjustUserPlaybackSignalVolume ( ulong  uid,
int  volume 
)
pure virtual

Adjusts the volume of local signal playback from a specified remote user.
After you join the room, you can call the method to adjust the volume of local audio playback from different remote users or repeatedly adjust the volume of audio playback from a specified remote user.

Note
  • You can call this method after joining a room.
  • The method is valid in the current call. If a remote user exits the room and rejoins the room again, the setting is still valid until the call ends.
  • The method adjusts the volume of the mixing audio published by a specified remote user. The volume of one remote user can be adjusted. If you want to adjust multiple remote users, you need to call the method for the required times.
Since
V4.5.0
Parameters
uidThe ID of a remote user.
volumePlayback volume: 0 to 100.
  • 0: Mute.
  • 100: The original volume.
Returns
  • 0: Success.
  • Other values: Failure.

◆ StartChannelMediaRelay()

abstract int nertc.IRtcChannel.StartChannelMediaRelay ( RtcChannelMediaRelayConfig  config)
pure virtual

Starts to relay media streams across rooms.

  • The method can invite co-hosts across rooms. Media streams from up to four rooms can be relayed. A room can receive multiple relayed media streams.
  • After you call this method, the SDK triggers ChannelOnMediaRelayStateChanged and ChannelOnMediaRelayEvent. The return reports the status and events about the current relayed media streams across rooms.
    Note
  • You can call this method after joining a room. Before you call the method, you must set the destination room in the RtcChannelMediaRelayConfig parameter in destInfos.
  • The method is applicable only to the host in live streaming.
  • If you want to call the method again, you must first call the StopChannelMediaRelay method to exit the current relaying status.
  • If you succeed in relaying the media stream across rooms, and want to change the destination room, for example, add or remove the destination room, you can call UpdateChannelMediaRelay to update the information about the destination room.
    Since
    V4.5.0
    Parameters
    configspecifies the configuration for the media stream relay across rooms. For more information, see RtcChannelMediaRelayConfig.
    Returns
    0
    A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ UpdateChannelMediaRelay()

abstract int nertc.IRtcChannel.UpdateChannelMediaRelay ( RtcChannelMediaRelayConfig  config)
pure virtual

Updates the information of the destination room for the media stream relay.
You can call this method to relay the media stream to multiple rooms or exit the current room.

  • You can call this method to change the destination room, for example, add or remove the destination room.
  • After you call this method, the SDK triggers ChannelOnMediaRelayStateChanged and ChannelOnMediaRelayEvent. The return reports the status and events about the current relayed media streams across rooms.
    Note
    Before you call the method, you must join the room and call StartChannelMediaRelay to relay the media stream across rooms. Before you call the method, you must set the destination room in the RtcChannelMediaRelayConfig parameter in destInfos.
    Since
    V4.5.0
    Parameters
    configThe configuration for destination rooms.
    Returns
    A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ StopChannelMediaRelay()

abstract int nertc.IRtcChannel.StopChannelMediaRelay ( )
pure virtual

Stops relaying media streams.
If the host leaves the room, media stream replay across rooms automatically stops. You can also call stopChannelMediaRelay. In this case, the host exits all destination rooms.

◆ SetLocalPublishFallbackOption()

abstract int nertc.IRtcChannel.SetLocalPublishFallbackOption ( RtcStreamFallbackOption  option)
pure virtual

Sets the fallback option for the published local video stream based on the network conditions.
The quality of the published local audio and video streams is degraded with poor quality network connections. After calling this method and setting the option to kNERtcStreamFallbackAudioOnly :

  • With unreliable upstream network connections and the quality of audio and video streams is downgraded, the SDK automatically disables video stream or stops receiving video streams. In this way, the communication quality is guaranteed.
  • The SDK monitors the network performance and recover audio and video streams if the network quality improves.
  • If the locally published audio and video stream falls back to audio stream, or recovers to audio and video stream, the SDK triggers the ChannelOnPublishFallbackToAudioOnly callback.
Note
You must call the method before you call JoinChannel .
Since
V4.5.0
Parameters
optionThe fallback option of publishing audio and video streams. The fallback kNERtcStreamFallbackAudioOnly is disabled by default. For more information, see nertc::NERTCStreamFallbackOption.
Returns
0
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ SetRemoteSubscribeFallbackOption()

abstract int nertc.IRtcChannel.SetRemoteSubscribeFallbackOption ( RtcStreamFallbackOption  option)
pure virtual

Sets the fallback option for the subscribed remote audio and video stream with poor network connections.
The quality of the subscribed audio and video streams is degraded with unreliable network connections. You can use the interface to set the option as kNERtcStreamFallbackVideoStreamLow or kNERtcStreamFallbackAudioOnly .

  • In unreliable downstream network connections, the SDK switches to receive a low-quality video stream or stops receiving video streams. In this way, the communication quality is maintained or improved.
  • The SDK monitors the network quality and resumes the video stream when the network condition improves.
  • If the subscribed remote video stream falls back to audio only, or the audio-only stream switches back to the video stream, the SDK triggers the ChannelOnSubscribeFallbackToAudioOnly callback.
Note
You must call the method before you call joinChannel.
Since
V4.5.0
Parameters
optionThe fallback option for the subscribed remote audio and video stream. With unreliable network connections, the stream falls back to a low-quality video stream of kNERtcStreamFallbackVideoStreamLow. For more information, see RtcStreamFallbackOption .
Returns
0
A value of 0 returned indicates that the method call is successful. Otherwise, the method call fails.

◆ SetExternalVideoSource()

abstract int nertc.IRtcChannel.SetExternalVideoSource ( bool  enabled)
pure virtual

Enables or disables the external video source.
When you enable the external video source through the method, you need to set kNERtcExternalVideoDeviceID as the ID of external video source with IVideoDeviceManager.SetDevice( kNERtcExternalVideoDeviceID ) method.

Note
The method enables the internal engine, which is still valid after you call LeaveChannel.
Parameters
[in]enabledSpecifies whether input external video source data.
  • true: Enables external video source.
  • false: Disables the external video source (default).
Returns
  • 0: Success.
  • Other values: Failure.

◆ PushExternalVideoFrame()

abstract int nertc.IRtcChannel.PushExternalVideoFrame ( RtcExternalVideoFrame  frame)
pure virtual

Pushes the external video frames.
The method actively pushes the data of video frames that are encapsulated with the RtcExternalVideoFrame class to the SDK. Make sure that you have already called SetExternalVideoSource with a value of true before you call this method. Otherwise, an error message is repeatedly prompted if you call the method.

Note
The method enables the internal engine, which is invalid after you call LeaveChannel.
Parameters
[in]frameThe video frame data.
Returns
  • 0: Success.
  • Other values: Failure.

◆ PushSubstreamExternalVideoFrame()

abstract int nertc.IRtcChannel.PushSubstreamExternalVideoFrame ( RtcExternalVideoFrame  videoFrame)
pure virtual

Pushes the external video frames.
The method actively pushes the data of video frames that are encapsulated with the RtcExternalVideoFrame class to the SDK. Make sure that you have already called StartScreenCapture with a value of true before you call this method. Otherwise, an error message is repeatedly prompted if you call the method.

Note
The method enables the internal engine, which is invalid after you call LeaveChannel.
Parameters
[in]videoFrameThe video frame data.
Returns
  • 0: success.
  • Other values: failure.

◆ EnableSpatializer()

abstract int nertc.IRtcChannel.EnableSpatializer ( bool  enable)
pure virtual

Enable or disable the spatializer

Note
Call the method before calling, the configuration will not be reset after the call ends
Parameters
enableWhether to enable the spatializer
Returns
  • 0: success.
  • Other values: failure.

◆ EnableAvatar()

abstract int nertc.IRtcChannel.EnableAvatar ( bool  enable)
pure virtual

Enable or disable a digital avatar.

Note
  • Call the method after the call starts. The server cleans up the setting only after the call ends.
  • Disable the digital avatar if a user leaves the room. The server reserves the setting when the user rejoin the room of the same cid using the same uid.
Parameters
enableWhether to enable a digital avatar.
Returns
  • 0: success.
  • Other values: failure.

The documentation for this class was generated from the following file: