setPublishStreamEncryptionKey method

Future<void> setPublishStreamEncryptionKey(
  1. String key,
  2. {ZegoPublishChannel? channel}
)

Set encryption key for the publishing stream for the specified publish channel.

Available since: 1.19.0 Description: Support calling this function to update the encryption key while publishing stream. When to call: After the engine is created createEngine, Called before and after startPublishingStream can both take effect. Restrictions: This function is only valid when publishing stream to the Zego RTC server. Caution: Note that developers need to update the player's decryption key before updating the publisher's encryption key. Related APIs: Calling stopPublishingStream or logoutRoom will clear the encryption key.

  • key The encryption key, note that the key length only supports 16/24/32 bytes.
  • channel Publish stream channel.

Implementation

Future<void> setPublishStreamEncryptionKey(String key,
    {ZegoPublishChannel? channel}) async {
  return await ZegoExpressImpl.instance
      .setPublishStreamEncryptionKey(key, channel: channel);
}