setE2eeEnabled method

  1. @override
Future<void> setE2eeEnabled({
  1. required String targetId,
  2. required bool isEnabled,
  3. bool isForce = false,
})
override

Implementation

@override
Future<void> setE2eeEnabled({
  required String targetId,
  required bool isEnabled,
  bool isForce = false,
}) async {
  final RTCPeerConnection? peerConnection =
      _subscribers[targetId]?.peerConnection;

  if (peerConnection == null) return;

  if (_subscribers[targetId]?.isE2eeEnabled == isEnabled && !isForce) {
    return;
  }

  _subscribers[targetId]?.isE2eeEnabled = isEnabled;

  await _frameCryptor.enableDecryption(
    peerConnection: peerConnection,
    codec: _subscribers[targetId]?.videoCodec ?? WebRTCCodec.h264,
    enabled: isEnabled,
  );
}