enableEncryptionEx

Enables or disables the built-in encryption.

virtual int enableEncryptionEx(const RtcConnection& connection, bool enabled, const EncryptionConfig& config) = 0;

After the user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again.

Applicable scenarios

Scenarios with higher security requirements.

Call timing

Call this method before joining a channel.

Restrictions

  • All users within the same channel must set the same encryption configurations when calling this method.
  • If you enable the built-in encryption, you cannot use the Media Push function.

Parameters

enabled
Whether to enable built-in encryption:
  • true: Enable the built-in encryption.
  • false: (Default) Disable the built-in encryption.
config
Built-in encryption configurations. See EncryptionConfig.
connection
The connection information. See RtcConnection.

Returns

  • 0: Success.
  • < 0: Failure.