StreamingConfig constructor

StreamingConfig({
  1. required String resolution,
  2. required String fps,
  3. required int bitrate,
  4. String codec = 'H264',
  5. int? audioBitrate,
})

Implementation

StreamingConfig({
  required this.resolution,
  required this.fps,
  required this.bitrate,
  this.codec = 'H264',
  this.audioBitrate,
}) {
  if (resolution.isEmpty) {
    throw ArgumentError.value(resolution, 'resolution', 'Must not be empty.');
  }
  if (fps.isEmpty) {
    throw ArgumentError.value(fps, 'fps', 'Must not be empty.');
  }
  if (codec.isEmpty) {
    throw ArgumentError.value(codec, 'codec', 'Must not be empty.');
  }
  if (bitrate <= 0) {
    throw ArgumentError.value(bitrate, 'bitrate', 'Must be positive.');
  }
  if (audioBitrate != null && audioBitrate! <= 0) {
    throw ArgumentError.value(
      audioBitrate,
      'audioBitrate',
      'Must be positive.',
    );
  }
}