startStatsReporting method

Future<void> startStatsReporting()

Implementation

Future<void> startStatsReporting() async {
  localSdp = await peerConnection.getLocalDescription();
  remoteSdp = await peerConnection.getRemoteDescription();

  if (!debugReportStarted) {
    debugStatsId = uuid.v4();
    _sendStartDebugReport(debugStatsId);
  }

  _sendAddConnectionMessage();
  _setupPeerEventHandlers();

  _timer = Timer.periodic(Duration(milliseconds: Constants.statsInterval),
      (_) async {
    await _collectAndSendStats();
  });
}