pause method

void pause()

Pauses sending media.

Implementation

void pause() {
  _logger.debug('pause()');

  if (closed) {
    _logger.error('pause() | Producer closed');

    return;
  }

  paused = true;

  if (disableTrackOnPause) {
    track.enabled = false;
  }

  if (zeroRtpOnPause) {
    safeEmitAsFuture('@replacetrack').catchError((error, stackTrace) {});
  }

  // Emit observer event.
  observer.safeEmit('pause');
}