enableEncryptionEx abstract method

Future<void> enableEncryptionEx({
  1. required RtcConnection connection,
  2. required bool enabled,
  3. required EncryptionConfig config,
})

Enable or disable built-in encryption.

After the user leaves the channel, the SDK automatically disables encryption. To enable encryption again, you need to call this method before the user rejoins the channel. All users in the same channel must set the same encryption mode and key when calling this method. If built-in encryption is enabled, the CDN live streaming feature cannot be used.

  • connection Connection information. See RtcConnection.
  • enabled Whether to enable built-in encryption: true : Enable built-in encryption. false : (default) Disable built-in encryption.
  • config Configure the built-in encryption mode and key. See EncryptionConfig.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> enableEncryptionEx(
    {required RtcConnection connection,
    required bool enabled,
    required EncryptionConfig config});