canProduce method

bool canProduce(
  1. RTCRtpMediaType kind
)

Whether we can produce audio/video.

@throws {InvalidStateError} if not loaded. @throws {TypeError} if wrong arguments.

Implementation

bool canProduce(RTCRtpMediaType kind) {
  if (!_loaded) {
    throw ('not loaded');
  } else if (kind != RTCRtpMediaType.RTCRtpMediaTypeAudio &&
      kind != RTCRtpMediaType.RTCRtpMediaTypeVideo) {
    throw ('invalid kind ${RTCRtpMediaTypeExtension.value(kind)}');
  }

  return _canProduceByKind!.canIt(kind);
}