Consumer constructor

Consumer({
  1. required String id,
  2. required String localId,
  3. required String producerId,
  4. RTCRtpReceiver? rtpReceiver,
  5. required MediaStreamTrack track,
  6. required RtpParameters rtpParameters,
  7. required Map<String, dynamic> appData,
  8. required MediaStream stream,
  9. String? peerId,
  10. bool closed = false,
})

@emits transportclose @emits trackended @emits @getstats @emits @close

Implementation

Consumer({
  required this.id,
  required this.localId,
  required this.producerId,
  this.rtpReceiver,
  required this.track,
  required this.rtpParameters,
  required this.appData,
  required this.stream,
  this.peerId,
  this.closed = false,
})  : observer = EnhancedEventEmitter(),
      super() {
  _logger.debug('constructor()');

  paused = !track.enabled;
  _handleTrack();
}