monitorStats method

  1. @override
Future<bool> monitorStats()
override

Implementation

@override
Future<bool> monitorStats() async {
  if (sender == null || events.isDisposed) {
    _currentBitrate = 0;
    return false;
  }
  final stats = await getSenderStats();

  if (stats != null && prevStats != null && sender != null) {
    _currentBitrate = computeBitrateForSenderStats(stats, prevStats);
    events.emit(
        AudioSenderStatsEvent(stats: stats, currentBitrate: currentBitrate));
  }

  prevStats = stats;
  return true;
}