reconnect method

  1. @override
Future<void> reconnect()
override

Implementation

@override
Future<void> reconnect() async {
  if (_mParticipant == null) return;

  _stats.dispose();
  _audioStats.dispose();
  await _mParticipant?.peerConnection.close();

  final RTCPeerConnection peerConnection = await _createPeerConnection(
    WebRTCConfigurations.offerPublisherSdpConstraints,
  );

  _mParticipant = _mParticipant?.copyWith(peerConnection: peerConnection);

  await _establishBroadcastConnection();
}