setCustomizeEncryptHandler method
@detail api @author wangjunlin.3182 @brief Sets custom encryption and decryption methods. @param handler Custom encryption handler, which needs to implement the encryption and decryption method. See ByteRTCEncryptHandler{@link #ByteRTCEncryptHandler}. @return - 0: Success. - < 0 : Fail. See ByteRTCReturnStatus{@link #ByteRTCReturnStatus} for more details @note - The method and setEncryptInfo:key:{@link #ByteRTCEngine#setEncryptInfo:key} are mutually exclusive relationships, that is, according to the call order, the last call method takes effect version. - This method must be called before calling joinRoom:userInfo:userVisibility:roomConfig:{@link #ByteRTCRoom#joinRoom:userInfo:userVisibility:roomConfig}, which can be called repeatedly, taking the last called parameter as the effective parameter. - Whether encrypted or decrypted, the length of the modified data needs to be controlled under 180%. That is, if the input data is 100 bytes, the processed data must be less than 180 bytes. If the encryption or decryption result exceeds the limit, the audio & video frame may be discarded. - Data encryption/decryption is performed serially, so depending on the implementation The method may affect the final rendering efficiency. Whether to use this method needs to be carefully evaluated by the user.
Implementation
FutureOr<int> setCustomizeEncryptHandler(
id<ByteRTCEncryptHandler> handler) async {
return await nativeCall('setCustomizeEncryptHandler:', [handler]);
}