Video SDK for MacOS API Reference
Loading...
Searching...
No Matches
ZMVideoSDKCmdChannel Class Reference

The command channel allows users to send commands or data (such as plain text or a binary encoded into string) to other users in the same session. More...

#include <ZMVideoSDKCmdChannel.h>

Inherits NSObject.

Instance Methods

(ZMVideoSDKErrors) - sendCommand:receiveUser:
 Sends custom commands or data to other users in the current session.
(ZMVideoSDKErrors) - sendCommandToSubSessionUser:subSessionUser:
 Sends a command to a user in the main session or a subsession.

Detailed Description

The command channel allows users to send commands or data (such as plain text or a binary encoded into string) to other users in the same session.

Definition at line 17 of file ZMVideoSDKCmdChannel.h.

Method Documentation

◆ sendCommand:receiveUser:

- (ZMVideoSDKErrors) sendCommand: (NSString *) commandContent
receiveUser: (nullable ZMVideoSDKUser *) user 

Sends custom commands or data to other users in the current session.

Parameters
commandContentThe custom commands or data, represented in string format.
userThe target user to receive the command. If nil, the command is broadcast to all users.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.
Note
This API is rate-limited; overly frequent calls return ZMVideoSDKErrors_Call_Too_Frequently.

◆ sendCommandToSubSessionUser:subSessionUser:

- (ZMVideoSDKErrors) sendCommandToSubSessionUser: (NSString *) commandContent
subSessionUser: (nullable ZMVideoSDKSubSessionUser *) subSessionUser 

Sends a command to a user in the main session or a subsession.

Parameters
commandContentThe custom command or data.
subSessionUserThe target lightweight user, obtained from a subsession user list.
Returns
If the function succeeds, it returns ZMVideoSDKErrors_Success. Otherwise, this function returns an error.