enableEncryptionEx abstract method

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

开启或关闭内置加密。

用户离开频道后,SDK 会自动关闭加密。如需重新开启加密,你需要在用户再次加入频道前调用该方法。 同一频道内的所有用户在调用该方法时,必须设置相同的加密模式和密钥。 如果开启了内置加密,则不能使用旁路推流功能。

  • connection Connection 信息。详见 RtcConnection 。
  • enabled 是否开启内置加密: true : 开启内置加密。 false :(默认)关闭内置加密。
  • config 配置内置加密模式和密钥。详见 EncryptionConfig 。

Returns 方法成功调用时,无返回值;方法调用失败时,会抛出 AgoraRtcException 异常,你需要捕获异常并进行处理。

Implementation

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