Data types
Contents
Data type | Description | Minimum supported version |
Information required to join a channel. | 3.0.0 | |
The configuration object for creating a camera video stream. | 3.0.0 | |
The configuration object for creating a microphone audio stream. | 3.0.0 | |
The configuration object for creating a screen sharing stream. | 3.0.0 | |
Configuration parameters for creating a custom audio track. | 3.0.0 | |
Configuration parameters for creating a custom video track. | 3.0.0 | |
The configuration object for adjusting video encoding. | 3.0.0 | |
The media track type. | 3.0.0 | |
Video capture specifications. | 3.0.0 | |
Device information. | 3.0.0 | |
The SDK connection state. | 3.0.0 | |
Information about a remote user in the channel. | 3.0.0 | |
The mode for subscribing to a remote video stream. | 3.0.0 | |
The reason for disconnecting from the server. | 3.0.0 | |
Statistics for the local audio track. | 3.0.0 | |
Statistics for the local video track. | 3.0.0 | |
Statistics for the remote video track. | 3.0.0 | |
Configuration parameters for video playback. | 3.0.0 | |
Network quality score. | 3.0.0 | |
Global configuration information for the local client. | 3.0.0 | |
Log level. | 3.0.0 | |
Batch subscribes to remote audio and video tracks. | 3.1.0 | |
Feedback on batch subscribing to remote audio and video tracks. | 3.1.0 | |
Batch unsubscribes from remote audio and video tracks. | 3.1.0 | |
Configuration items for joining an audio group. | 3.4.0 | |
Information about the audio group. | 3.4.0 | |
Information about audio group members. | 3.4.0 | |
The event type for group property changes. | 3.5.0 |
Data type details
JoinParam
Parameters required to join a channel.
interface JoinParam
Property | Type | Description | Version |
appId | string | The AppId of your project in DingRTC. Only letters, digits, and underscores (_) are supported. | 3.0.0 |
channel | string | The channel ID. The ID can contain only letters, digits, underscores (_), and hyphens (-). The length cannot exceed 64 characters. | 3.0.0 |
token | string | The token used for authentication. | 3.0.0 |
uid | string | The user ID. The ID can contain only letters, digits, underscores (_), and hyphens (-). The length cannot exceed 64 characters. | 3.0.0 |
userName | string | The username. The length cannot exceed 64 bytes in UTF-8 encoding. | 3.0.0 |
CameraVideoTrackConfig
The configuration object for creating a camera video stream.
interface CameraVideoTrackConfig
Property | Type | Description | Version |
deviceId? | string | (Optional) The ID of the camera device. To get the list of current camera devices, call getCameras. | 3.0.0 |
dimension? | (Optional) The video capture specifications. | 3.0.0 | |
frameRate? | number | (Optional) The frame rate. | 3.0.0 |
facingMode? | 'user' | 'environment' | (Optional) On a mobile device, specifies whether to use the front or rear camera to capture video. | 3.0.0 |
maxBitrate? | number | (Optional) The maximum bitrate in Kbps. If you do not set this parameter, the SDK calculates a value internally. | 3.0.1 |
optimizationMode? | 'detail' | 'motion' | 'balanced' | (Optional) The video transmission optimization mode: balanced: The default transmission optimization mode. This mode prioritizes clarity for screen sharing streams. For other video stream types, it balances clarity and smoothness. The frame rate and resolution are adjusted in poor network conditions. detail: Prioritizes clarity. The resolution is not reduced in most cases, but the frame rate may be reduced. motion: Prioritizes smoothness. The frame rate is not reduced in most cases, but the sending resolution may be reduced. | 3.5.0 |
mirror? | boolean | (Optional) Enables mirroring for the published stream. This feature is disabled by default. It only affects remote playback. If Client Video Orientation (CVO) is configured, mirroring is applied after rotation. | 3.6.0 |
MicrophoneAudioTrackConfig
The configuration object for creating a microphone audio stream.
Type signature
interface MicrophoneAudioTrackConfig
Property | Type | Description | Version |
AEC? | boolean | (Optional) Specifies whether to enable acoustic echo cancellation (AEC). | 3.0.0 |
AGC? | boolean | (Optional) Specifies whether to enable automatic gain control (AGC). | 3.0.0 |
ANS? | boolean | (Optional) Specifies whether to enable automatic noise suppression (ANS). | 3.0.0 |
deviceId? | string | (Optional) The device ID. | 3.0.0 |
ScreenVideoTrackConfig
The configuration object for creating a screen sharing stream.
Type signature
interface ScreenVideoTrackConfig
Property | Type | Description | Version |
dimension? | (Optional) The video specifications. | 3.0.0 | |
displaySurface? | 'browser' | 'window' | 'monitor' | (Optional) The default content type for screen sharing. You can set this to a browser tab, an application window, or the entire screen. | 3.0.0 |
frameRate? | number | (Optional) The frame rate. | 3.0.0 |
maxBitrate? | number | (Optional) The maximum bitrate in Kbps. If you do not set this parameter, the SDK calculates a value internally. | 3.0.1 |
optimizationMode? | 'detail' | 'motion' | 'balanced' | (Optional) The video transmission optimization mode: balanced: The default transmission optimization mode. This mode prioritizes clarity for screen sharing streams. For other video stream types, it balances clarity and smoothness. The frame rate and resolution are adjusted in poor network conditions. detail: Prioritizes clarity. The resolution is not reduced in most cases, but the frame rate may be reduced. motion: Prioritizes smoothness. The frame rate is not reduced in most cases, but the sending resolution may be reduced. | 3.5.0 |
VideoEncoderConfiguration
The configuration object for video encoding.
interface VideoEncoderConfiguration
Property | Type | Description | Version |
dimension? | (Optional) The video capture specifications. | 3.0.0 | |
frameRate? | number | (Optional) The frame rate. | 3.0.0 |
maxBitrate? | number | (Optional) The maximum bitrate in Kbps. If you do not set this parameter, the SDK calculates a value internally. | 3.0.1 |
optimizationMode? | 'detail' | 'motion' | 'balanced' | (Optional) The video transmission optimization mode: balanced: The default transmission optimization mode. This mode prioritizes clarity for screen sharing streams. For other video stream types, it balances clarity and smoothness. The frame rate and resolution are adjusted in poor network conditions. detail: Prioritizes clarity. The resolution is not reduced in most cases, but the frame rate may be reduced. motion: Prioritizes smoothness. The frame rate is not reduced in most cases, but the sending resolution may be reduced. | 3.5.0 |
mirror? | boolean | (Optional) Enables mirroring for the published stream. This feature is disabled by default. It only affects remote playback. If CVO is configured, mirroring is applied after rotation. This property is supported only for camera tracks. | 3.6.0 |
VideoDimension
Video capture specifications
type VideoDimension =
'VD_120x120' |
'VD_160x120' |
'VD_180x180' |
'VD_240x180' |
'VD_320x180' |
'VD_240x240' |
'VD_320x240' |
'VD_424x240' |
'VD_360x360' |
'VD_480x360' |
'VD_640x360' |
'VD_480x480' |
'VD_640x480' |
'VD_840x480' |
'VD_960x540' |
'VD_960x720' |
'VD_1280x720' |
'VD_1920x1080';TrackMediaType
Media track type
type TrackMediaType = 'audio' | 'video';CustomVideoTrackConfig
Parameters for configuring a custom video track.
Type signature
interface CustomVideoTrackConfig
Property | Type | Description | Version |
dimension? | (Optional) The video specifications. | 3.0.0 | |
frameRate? | number | (Optional) The frame rate. | 3.0.0 |
mediaStreamTrack | MediaStreamTrack | The MediaStreamTrack object that you maintain. | 3.0.0 |
maxBitrate? | number | (Optional) The maximum bitrate in Kbps. If you do not set this parameter, the SDK calculates a value internally. | 3.0.1 |
CustomAudioTrackConfig
Parameters to configure a custom audio track.
Type signature
interface CustomAudioTrackConfig
Property | Type | Description | Version |
mediaStreamTrack | MediaStreamTrack | The MediaStreamTrack object that you maintain. | 3.0.0 |
DeviceInfo
Device information
Type signature
interface DeviceInfo
Property | Type | Description | Version |
device | The information of the capture device. | 3.0.0 | |
state | 'active' | 'inactive' | The plug-in state of the capture device. "active": The device is plugged in. "inactive": The device is unplugged. | 3.0.0 |
ConnectionState
The state of the SDK connection.
Type signature
type ConnectionState =
'disconnected' |
'connecting' |
'reconnecting' |
'connected' |
'disconnecting';RemoteUser
Contains information about a remote user in the channel. You can obtain this information from DingRTCClient.remoteUsers or events such as DingRTCClient.on("user-joined").
This object provides information on the state of a remote user in the channel, including their user ID and audio/video publishing status.
If a remote user has published a stream, subscribe to it by passing this object to DingRTCClient.subscribe. Once the subscription is successful, retrieve the remote audio or video track object from the object's audioTrack or videoTrack field for playback.
Properties
Property | Type | Description | Version |
audioMuted | boolean | Indicates whether the remote microphone is muted. | 3.0.0 |
videoMuted | boolean | Indicates whether the remote camera is disabled. | 3.0.0 |
auxiliaryMuted | boolean | Indicates whether remote screen sharing is disabled. | 3.0.0 |
audioTrack | If you have successfully subscribed to the remote user's audio, this field stores the remote audio track object. | 3.0.0 | |
auxiliaryTrack | If you have successfully subscribed to the remote user's screen sharing, this field stores the remote screen sharing video track object. | 3.0.0 | |
hasAudio | boolean | Indicates whether the remote user is sending audio. | 3.0.0 |
hasAuxiliary | boolean | Indicates whether the remote user is sending a screen sharing stream. | 3.0.0 |
hasVideo | boolean | Indicates whether the remote user is sending video. | 3.0.0 |
userId | string | The ID of the remote user. | 3.0.0 |
videoTrack | If you have successfully subscribed to the remote user's video, this field stores the remote video track object. | 3.0.0 |
RemoteStreamType
The subscription mode for a remote video stream.
Type signature
type RemoteStreamType = 'high' | 'low' | 'FHD' | 'HD' | 'SD' | 'LD';
Type | Description | Version |
high | Ultra-high definition (UHD) stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 1080p billing tier. | 3.0.0 |
FHD | Full high definition (FHD) stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 1080p billing tier. | 3.3.0 |
HD | High definition (HD) stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 720p billing tier. | 3.3.0 |
SD | Standard definition (SD) stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 480p billing tier. | 3.3.0 |
LD | Low definition (LD) stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 480p billing tier. | 3.3.0 |
low | Low definition stream. This quality is available if the device performance, network conditions, and stream ingest resolution meet the requirements. This corresponds to the 480p billing tier. | 3.0.0 |
DisconnectedReason
The reason for the server disconnection.
Type signature
type DisconnectedReason =
'leave' | // The user left the channel voluntarily.
'network_error' | // A client-side network connection error occurred.
'server_error' | // A server-side error occurred.
'uid_banned' | // The user ID was banned.
'uid_replaced' | // The user was replaced by another user who logged on with the same user ID.
'channel_banned' | // The channel was closed.
'timeout'; // The user timed out and left the channel.LocalAudioStates
Statistics of the local audio track.
Type signature
interface LocalAudioStates
Property | Type | Description | Version |
channelCount? | number | (Optional) The number of captured sound channels. | 3.0.0 |
codec? | string | (Optional) The audio encoding format. | 3.0.0 |
sampleRate? | number | (Optional) The audio sampling rate. | 3.0.0 |
sendBytes? | number | (Optional) The total number of audio bytes sent. | 3.0.0 |
sendPackets? | number | (Optional) The total number of audio packets sent. | 3.0.0 |
sendPacketsLost? | number | (Optional) The total number of lost audio packets sent. | 3.0.0 |
timestamp? | number | (Optional) The UNIX timestamp when the call is made. | 3.0.0 |
rtt? | number | (Optional) The round-trip time in ms. | 3.0.0 |
LocalVideoStatesMap
Statistics of the local video track.
Type signature
interface LocalVideoStatesMap
Property | Type | Description | Version |
auxiliary? | (Optional) Screen sharing statistics. | 3.0.0 | |
camera? | (Optional) Video data statistics. | 3.0.0 |
LocalVideoStates
The statistics of the local video track.
Type signature
interface LocalVideoStates
Property | Type | Description | Version |
captureFrameRate? | number | (Optional) The video capture frame rate in fps. This value cannot be obtained in Safari and Firefox. | 3.0.0 |
captureResolution? | Resolution | (Optional) The video capture resolution. | 3.0.0 |
codec? | string | (Optional) The video encoding format. | 3.0.0 |
encodeFrameRate? | number | (Optional) The encoding frame rate. | 3.0.0 |
outgoingBitrate? | number | (Optional) The available bitrate for local transmission. | 3.0.0 |
qpSum? | number | (Optional) The number of frames with QP values encoded by the sender. | 3.0.0 |
sendBitrate? | number | (Optional) The video sending bitrate in bps. | 3.0.0 |
sendBytes? | number | (Optional) The total number of video bytes sent. | 3.0.0 |
sendFrameRate? | number | (Optional) The video sending frame rate in fps. | 3.0.0 |
sendPackets? | number | (Optional) The total number of video packets sent. | 3.0.0 |
sendPacketsLost? | number | (Optional) The total number of lost video packets sent. | 3.0.0 |
sendResolution? | Resolution | (Optional) The video sending resolution. | 3.0.0 |
targetBitrate? | number | (Optional) The target sending bitrate. | 3.0.0 |
timestamp? | number | (Optional) The UNIX timestamp when the call is made. | 3.0.0 |
rtt? | number | (Optional) The round-trip time in ms. | 3.0.0 |
RemoteVideoStates
Statistics for the remote video track, including connection and transmission information.
Type Signature
interface RemoteVideoStates
Property | Type | Description | Version |
codec? | string | (Optional) The video encoding format. | 3.0.0 |
decodeFrameRate? | number | (Optional) The video decoding frame rate. | 3.0.0 |
receiveBitrate? | number | (Optional) The bitrate for sending video, in bps. | 3.0.0 |
receiveBytes? | number | (Optional) The total number of received video bytes. | 3.0.0 |
receiveFrameRate? | number | (Optional) The frame rate for sending video (fps). | 3.0.0 |
receivePackets? | number | (Optional) The total number of received video packets. | 3.0.0 |
receivePacketsLost? | number | (Optional) The total number of lost video packets during reception. | 3.0.0 |
receiveResolution? | Resolution | (Optional) The resolution of the received video. | 3.0.0 |
timestamp? | number | (Optional) The timestamp of the call. | 3.0.0 |
rtt? | number | (Optional) The round-trip time (RTT), in ms. | 3.0.0 |
RemoteVideoStatesMap
Statistics information for remote video streams, where the key is the user ID (`uid`) and the value is the statistics information for the corresponding user's video.
Type Signature
interface RemoteVideoStatesMap {
[uid: string]: {
camera?: RemoteVideoStates;
auxiliary?: RemoteVideoStates;
};
}VideoPlayerConfig
Configuration parameters for video playback
Type Signature
interface VideoPlayerConfig
Property | Type | Description | Version |
fit? | 'contain' | 'cover' | 'fill' | (Optional) The video fill type. | 3.0.0 |
mirror? | boolean | (Optional) Specifies whether to mirror the video during playback. | 3.0.0 |
GlobalClientConfigInfo
Global configuration of the local client
Type Signature
interface GlobalClientConfigInfo
Property | Type | Description | Version |
gslb? | string | string[] | (Optional) The HTTP address of the GSLB domain name. You do not usually need to configure this property. If configuration is required, contact technical support for the latest information. | 3.0.0 |
NetworkQuality
After a local user joins a channel, the SDK triggers the "network-quality" callback every two seconds to report the user's uplink and downlink network quality. The quality is calculated based on the average round-trip time and packet loss rate.
-0: Network status unknown
Superior network performance
-2 The network connection is stable.
-3 Standard network
-4 Poor network connection
-5 Extremely poor network connection
Error code -6: The network is disconnected.
Type signature:
type NetworkQuality = 0 | 1 | 2 | 3 | 4 | 5 | 6;LogLevel
Setting a log level lets you view logs at that level and higher.
-debug: Outputs all logs.
-info Outputs info, error, and warning logs
-warn: Outputs error and warning logs.
-error: Outputs the error log.
-none Disables log output
Type signature
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';SubscribeParam
You can subscribe to user audio and video tracks in a batch.
interface SubscribeParam
Property | Type | Description | Version |
uid | string | The user ID of the remote user. | 3.1.0 |
mediaType | The type of the subscribed media track. | 3.1.0 | |
auxiliary? | string | Whether the subscribed video track is a shared stream. | 3.1.0 |
SubscribeResult
Callback for batch subscription to user audio and video tracks
interface SubscribeResult
Property | Type | Description | Version |
uid | string | The user ID of the remote user. | 3.1.0 |
auxiliary? | string | Indicates whether the subscribed video track is a shared stream. | 3.1.0 |
track | The audio or video track object that is returned after the subscription is complete. | 3.1.0 | |
error | DingRTCError | The error message returned when the subscription fails. | 3.1.0 |
UnsubscribeParam
Batch unsubscribing from user audio and video tracks
interface UnsubscribeParam
Property | Type | Description | Version |
uid | string | The user ID of the remote user. | 3.1.0 |
mediaType | The type of the media track to unsubscribe from. | 3.1.0 | |
auxiliary? | string | Specifies whether the video track to unsubscribe from is a screen sharing stream. | 3.1.0 |
JoinGroupConfig
Configuration for joining a specified audio group
interface JoinGroupConfig
Property | Type | Description | Version |
groupId | string | The ID of the audio group to join or create. | 3.4.0 |
userData? | string | Custom data to include when joining the group. | 3.4.0 |
publishAudioToGroup? | boolean | Specifies whether to automatically mix the audio stream into the group upon joining. | 3.4.0 |
Group
Audio Group Information
interface Group
Property | Type | Description | Version |
id | string | The audio group ID. | 3.4.0 |
uses | A list of members in the audio group. | 3.4.0 | |
audioPublished | boolean | Indicates whether audio is mixed into the group. | 3.4.0 |
joined | boolean | Indicates whether the user has joined the group. | 3.4.0 |
GroupUser
Member information for the audio group
interface GroupUser
Property | Type | Description | Version |
userId | string | The user ID of the audio group member. | 3.4.0 |
userData? | string | The custom data provided when the member joins the group. | 3.4.0 |
GroupPropertyUpdateTypes
Types of Group Property Change Events
type GroupPropertyUpdateTypes = 'set-name' | 'remove-name';