enableEncryption abstract method
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.
enabledWhether to enable built-in encryption: true : Enable built-in encryption. false : (default) Disable built-in encryption.configConfigure 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. See Error Codes for details and resolution suggestions.
Implementation
Future<void> enableEncryption(
{required bool enabled, required EncryptionConfig config});