Creates a new RTMS Client instance
Each Client instance represents a connection to a single Zoom meeting. You can create multiple Client instances to connect to different meetings.
Joins a Zoom RTMS session with parameters object
This method establishes a connection to a Zoom RTMS stream. After joining, callback methods will be invoked as events occur.
An object containing join parameters
true if the join operation succeeds
Joins a Zoom RTMS session with individual parameters
This method establishes a connection to a Zoom RTMS stream. After joining, callback methods will be invoked as events occur.
The UUID of the Zoom meeting
The RTMS stream ID for this connection
The authentication signature
The server URL(s) to connect to
Optional
timeout: numberThe timeout for the join operation in milliseconds
true if the join operation succeeds
Sets a callback for receiving audio data
This callback is triggered when audio data is received from the meeting. It provides the raw audio data buffer and metadata about the sender.
The callback function to invoke
true if the callback was set successfully
client.onAudioData((buffer, size, timestamp, metadata) => {
console.log(`Received ${size} bytes of audio from ${metadata.userName}`);
// Process the audio data
// buffer - Raw audio data (Buffer)
// size - Size of the audio data in bytes
// timestamp - Timestamp of the audio data
// metadata - Information about the sender
});
Sets a callback for receiving deskshare data
This callback is triggered when data is received from the meeting. It provides the raw audio data buffer and metadata about the sender.
The callback function to invoke
true if the callback was set successfully
client.onDsData((buffer, size, timestamp, metadata) => {
console.log(`Received ${size} bytes of deskshare data from ${metadata.userName}`);
// Process the data
// buffer - Raw deskshare data (Buffer)
// size - Size of the deskshare data in bytes
// timestamp - Timestamp of the deskshare data
// metadata - Information about the sender
});
Sets a callback for join confirmation events
This callback is triggered when the join operation is confirmed by the server.
The callback function to invoke
true if the callback was set successfully
Sets a callback for leave events
This callback is triggered when the client leaves the meeting, either voluntarily or due to an error.
The callback function to invoke
true if the callback was set successfully
Sets a callback for session update events
This callback is triggered when session information is updated. It provides details about session status changes (add, stop, pause, resume).
The callback function to invoke
true if the callback was set successfully
Sets a callback for receiving transcript data
This callback is triggered when transcript data is received from the meeting. It provides the raw transcript data buffer and metadata about the sender.
The callback function to invoke
true if the callback was set successfully
Sets a callback for user update events
This callback is triggered when users join or leave the meeting. It provides information about the participant who joined or left.
The callback function to invoke
true if the callback was set successfully
client.onUserUpdate((op, participantInfo) => {
// op = USER_EVENT_JOIN or USER_EVENT_LEAVE
if (op === rtms.USER_EVENT_JOIN) {
console.log(`User joined: ${participantInfo.name} (ID: ${participantInfo.id})`);
} else {
console.log(`User left: ${participantInfo.name} (ID: ${participantInfo.id})`);
}
});
Sets a callback for receiving video data
This callback is triggered when video data is received from the meeting. It provides the raw video data buffer, track ID, and metadata about the sender.
The callback function to invoke
true if the callback was set successfully
client.onVideoData((buffer, size, timestamp, trackId, metadata) => {
console.log(`Received ${size} bytes of video from ${metadata.userName}`);
console.log(`Track ID: ${trackId}`);
// Process the video data
// buffer - Raw video data (Buffer)
// size - Size of the video data in bytes
// timestamp - Timestamp of the video data
// trackId - ID of the video track
// metadata - Information about the sender
});
Manually polls for events from the RTMS server
This method is automatically called by the SDK's internal polling mechanism. You typically don't need to call this manually.
true if the poll operation succeeds
Releases client resources
This method disconnects from the server and releases resources. It's automatically called by the leave method.
true if the release operation succeeds
Sets audio parameters for the client
This method configures audio processing parameters.
Audio parameters configuration
true if the operation succeeds
Sets deskshare parameters for the client
This method configures deskshare video processing parameters.
Deskshare parameter configuration
true if the operation succeeds
Sets video parameters for the client
This method configures video processing parameters.
Video parameters configuration
true if the operation succeeds
Gets the stream ID of the current connection
The RTMS stream ID
Gets the UUID of the current meeting
The meeting UUID
Static
initializeInitializes the RTMS SDK with the specified CA certificate path
This static method must be called before creating any Client instances. It's automatically called by the join method if not already initialized.
Optional
caPath: stringPath to the CA certificate file (defaults to system CA)
true if initialization succeeds
Static
uninitializeUninitializes the RTMS SDK and releases resources
This static method should be called when you're done using the SDK. It releases all system resources allocated by the SDK.
true if uninitialization succeeds
RTMS Client: Core interface for connecting to Zoom real-time media streams
The Client class provides the main interface for connecting to and processing Zoom RTMS streams. Use this approach when you need to:
Example