setKeyProvider static method

void setKeyProvider(
  1. BaseKeyProvider provider
)

Installs the key provider used for end-to-end encryption. Turn E2EE off with removeKeyProvider.

Call before joining: the engine attaches a frame cryptor to every sender/receiver at join time. Replays the provider's keys, so a provider populated before the plugin was attached still reaches the engine.

Implementation

static void setKeyProvider(BaseKeyProvider provider) {
  _keyProvider = provider;
  unawaited(pushKeyProvider(provider)
      .catchError((e) => log('videosdk: setKeyProvider failed: $e')));
}