setKeyIndex method

Future<void> setKeyIndex(
  1. int keyIndex, {
  2. String? participantIdentity,
})

Sets the key index for the encryptors of the participant. @param keyIndex the key index to set @param participantIdentity the identity of the participant, if null, use local participant.

Implementation

Future<void> setKeyIndex(int keyIndex, {String? participantIdentity}) async {
  participantIdentity ??= _room?.localParticipant?.identity;
  for (var item in _frameCryptors.entries) {
    if (item.key.keys.first == participantIdentity) {
      await item.value.setKeyIndex(keyIndex);
    }
  }
}