setEncryptInfo method

FutureOr<int> setEncryptInfo(
  1. ByteRTCEncryptType encrypt_type,
  2. NSString key
)

@detail api @author wangjunlin.3182 @brief Sets the way to use built-in encryption when transmitting. @param encrypt_type Built-in encryption algorithm. See ByteRTCEncryptType{@link #ByteRTCEncryptType} @param key Encryption key, limited to 36 bits in length, beyond which it will be truncated @return - 0: Success. - < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details @note - Use this method when using built-in encryption when transmitting; if you need to use transmission See onEncryptData:{@link #ByteRTCEncryptHandler#onEncryptData}. Built-in encryption and custom encryption mutex, determine the scheme of transmission encryption according to the last called method.
- This method must be called before entering the room, and can be called repeatedly, taking the last called parameter as the effective parameter.

Implementation

FutureOr<int> setEncryptInfo(
    ByteRTCEncryptType encrypt_type, NSString key) async {
  return await nativeCall('setEncryptInfo:key:', [encrypt_type.$value, key]);
}