NERtc Unity SDK
V4.5.907
|
The IRtcChannel class provides methods that enable real-time communications in a specified channel. By creating multiple IRtcChannel instances, users can join multiple channels.
|
pure virtual |
Gets the engine object.
|
pure virtual |
Destroys an IRtcChannel instance to release resources.
|
pure virtual |
Gets the current channel name.
|
pure virtual |
Joins a channel of audio and video call.
[in] | token | The certification signature used in authentication (NERTC Token). Valid values:
|
[in] | uid | The 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. |
|
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.
|
pure virtual |
Registers a stats observer.
[in] | observer | The stats observer. |
|
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.
[in] | enabled |
|
|
pure virtual |
Enables or disabling publishing the local audio stream. The method is used to enable or disable publishing the local audio stream.
[in] | mute | Mute or Unmute.
|
|
pure virtual |
Enables or disables local audio capture and rendering.
The method enables local video capture.
[in] | enabled | Whether to enable local video capture and rendering.
|
|
pure virtual |
Stops or resumes sending the local video stream.
If the method is called Successfully, ChannelOnUserVideoMute is triggered remotely.
[in] | mute |
|
|
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.
screenRect | The relative position of the screen to virtual screens that is shared. |
regionRect | The 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. |
captureParams | The configurations of screen sharing. |
|
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.
displayId | The ID of the screen to be shared. Developers need to specify the screen they share through the parameters. |
regionRect | The relative position of shared screen to the full screen. |
captureParams | The configurations of screen sharing. |
|
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.
windowId | The ID of the window to be shared. |
regionRect | The relative position of shared screen to the full screen. |
captureParams | The configurations of screen sharing. |
|
pure virtual |
Start screen capture from external video sources.
captureParams | encoding parameters. Screen capture parameters becomes invalid. |
externalCapturer | whether capture from external. |
|
pure virtual |
When sharing a screen or window, updates the shared region.
regionRect | The 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. |
|
pure virtual |
Stops screen sharing.
If you use the method to disable the substream after joining a room, the ChannelOnUserSubStreamVideoStop callback is remotely triggered.
|
pure virtual |
Pauses screen sharing.
|
pure virtual |
Resumes screen sharing.
|
pure virtual |
Sets the window list that need to be blocked in capturing screens. The method can be dynamically called in the capturing.
windowList | The ID of the screen to be blocked. |
|
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.
[in] | canvas | The video canvas information. |
|
pure virtual |
Sets a remote substream canvas.
[in] | canvas | The video canvas information. |
|
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.
[in] | scalingMode | The video display mode. RtcVideoScalingMode . |
|
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.
[in] | scalingMode | The video display mode. RtcVideoScalingMode . |
|
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.
[in] | mirrorMode | The video mirror mode. For more information, see RtcVideoMirrorMode. |
|
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.
[in] | uid | The ID of a remote user. |
[in] | canvas | The video canvas information. |
|
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.
[in] | uid | The ID of a remote user. |
[in] | canvas | The video canvas settings. |
|
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.
[in] | uid | The ID of a remote user. |
[in] | scalingMode | The video display mode. RtcVideoScalingMode . |
|
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.
[in] | uid | The ID of a remote user. |
[in] | scalingMode | The video display mode. RtcVideoScalingMode . |
|
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.
[in] | role | The role of a user. RtcClientRole . |
|
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.
priority | The priority of the local media stream. The default value is kNERtcMediaPriorityNormal . For more information, see RtcMediaPriorityType . |
isPreemptive | specifies whether to enable the preempt mode. The default value is false, which indicates that the preempt mode is disabled.
|
|
pure virtual |
Gets the current connection status.
|
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:
config | The camera capturer configuration. |
|
pure virtual |
Unsubscribes or subscribes to audio streams from all remote users.
subscribe | Whether to unsubscribe audio streams from all remote users. |
|
pure virtual |
Sets local video parameters.
You can call this method before or after you join the room.
[in] | config | Sets the video encoding parameters. For more information, see RtcVideoConfig. |
|
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.
[in] | enable | Whether to enable dual-stream mode.
|
|
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.
[in] | uid | The user ID. |
[in] | subscribe |
|
|
pure virtual |
Subscribes or unsubscribes video streams from specified remote users.
[in] | uid | The user ID. |
[in] | type | The type of the subscribed video streams. RtcRemoteVideoStreamType. |
[in] | 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.
[in] | uid | The user ID. |
[in] | subscribe |
|
|
pure virtual |
After the method is successfully called, the current user can receive the notification about the status of the live stream.
[in] | info | indicates information of live task. For more information, see RtcLiveStreamTaskInfo . |
|
pure virtual |
Updates and modifies a push task in a room.
[in] | info | indicates information of live task. For more information, see RtcLiveStreamTaskInfo . |
|
pure virtual |
Deletes a push task.
[in] | taskId | The ID of a live streaming task. |
|
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.
data | The custom SEI frame data. |
length | The custom SEI data size whose maximum value does not exceed 4096 bytes. |
type | The type of the stream channel with which the SEI data is transmitted. For more information, see RtcVideoStreamType. |
|
pure virtual |
Adds a watermark image to the local video.
type | The type of video streams. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType. |
config | The 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. |
|
pure virtual |
Adds a watermark to the remote video canvas.
uid | The ID of a remote user. |
type | The type of video streams. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType. |
config | The 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. |
|
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.
streamType | The video stream type of the snapshot. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType. |
callback | The snapshot callback. For information, see RtcTakeSnapshotCallback. |
|
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.
uid | The ID of a remote user. |
streamType | The video stream type of the snapshot. You can set the value to mainstream or substream. For more information, see RtcVideoStreamType. |
callback | The snapshot callback. For information, see RtcTakeSnapshotCallback. |
|
pure virtual |
Adjusts the volume of captured signals.
[in] | volume | indicates the volume of the captured recording. Valid values: 0 to 400. Where:
|
|
pure virtual |
Adjusts the volume of the audio local playback.
[in] | volume | indicates the playback volume. Valid range: 0 to 400. Where:
|
|
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.
uid | The ID of a remote user. |
volume | Playback volume: 0 to 100.
|
|
pure virtual |
Starts to relay media streams across rooms.
destInfos
.config | specifies the configuration for the media stream relay across rooms. For more information, see RtcChannelMediaRelayConfig. |
|
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.
destInfos
. config | The configuration for destination rooms. |
|
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.
|
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 :
option | The fallback option of publishing audio and video streams. The fallback kNERtcStreamFallbackAudioOnly is disabled by default. For more information, see nertc::NERTCStreamFallbackOption. |
|
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 .
option | The 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 . |
|
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.
[in] | enabled | Specifies whether input external video source data.
|
|
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.
[in] | frame | The video frame data. |
|
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.
[in] | videoFrame | The video frame data. |
|
pure virtual |
Enable or disable the spatializer
enable | Whether to enable the spatializer |
|
pure virtual |
Enable or disable a digital avatar.
enable | Whether to enable a digital avatar. |